Auto get files from url with no prompt

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
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.

Forum statistics

Threads
1,223,898
Messages
6,175,274
Members
452,628
Latest member
dd2

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top