tmmellor1981
Board Regular
- Joined
- Jan 18, 2009
- Messages
- 122
Afternoon All
The following code below fetches serveral files i link to, the only problem is that upon getting each file I get a prompt asking if i'm sure I want to open the file, is there a method of having the code to auto click ok and continue with all the files automatically, i did try changing security settings but still get prompted. many thanks
Private Sub CommandButton1_Click()
Const strPath As String = "Q:\FileTransfer\"
Const strName As String = "NewFile_"
Dim strFile As String, lnum As Long
Application.ScreenUpdating = False
Application.DisplayAlerts = False
'Increase 5 to number of file to open, save and close
For lnum = 1 To 5
'Increase file names and paths to as max of "lNum"
strFile = Choose(lnum, ""https://www.xxxxxx.com", _
"https://www.xxxxxx.com", _
"https://www.xxxxxx.com", _
"https://www.xxxxxx.com", _
"https://www.xxxxxx.com")
ThisWorkbook.FollowHyperlink strFile
With ActiveWorkbook
.SaveAs strPath & strName & lnum
.Close
End With
Next lnum
Application.ScreenUpdating = True
Application.DisplayAlerts = True
End Sub
The following code below fetches serveral files i link to, the only problem is that upon getting each file I get a prompt asking if i'm sure I want to open the file, is there a method of having the code to auto click ok and continue with all the files automatically, i did try changing security settings but still get prompted. many thanks
Private Sub CommandButton1_Click()
Const strPath As String = "Q:\FileTransfer\"
Const strName As String = "NewFile_"
Dim strFile As String, lnum As Long
Application.ScreenUpdating = False
Application.DisplayAlerts = False
'Increase 5 to number of file to open, save and close
For lnum = 1 To 5
'Increase file names and paths to as max of "lNum"
strFile = Choose(lnum, ""https://www.xxxxxx.com", _
"https://www.xxxxxx.com", _
"https://www.xxxxxx.com", _
"https://www.xxxxxx.com", _
"https://www.xxxxxx.com")
ThisWorkbook.FollowHyperlink strFile
With ActiveWorkbook
.SaveAs strPath & strName & lnum
.Close
End With
Next lnum
Application.ScreenUpdating = True
Application.DisplayAlerts = True
End Sub