jrobin5881
Technical User
I'm running VBA code in EXCEL that will follow a hyperlink on a spreadsheet and I'm getting a warning message, "Opening (not the real address because I didn't want to post actual address on internet)
Some files can contain viruses or otherwise be harmful to your computer. It is important to be certain that this file is from a trustworthy source.Would you like to open this file? OK - Cancel."
I tried using Application.DisplayAlerts = False to get around the message and that does not work. Then I turned on the Macro recorder to see how that would handle it and i cut and pasted the code into my test module and that did not work either.
Is there anyway to programitically get around the message? Is it a setting that I have to do in options or is can I use VBA?
Below is My code:
And this is the Macro Recorded Code:
Some files can contain viruses or otherwise be harmful to your computer. It is important to be certain that this file is from a trustworthy source.Would you like to open this file? OK - Cancel."
I tried using Application.DisplayAlerts = False to get around the message and that does not work. Then I turned on the Macro recorder to see how that would handle it and i cut and pasted the code into my test module and that did not work either.
Is there anyway to programitically get around the message? Is it a setting that I have to do in options or is can I use VBA?
Below is My code:
Code:
Sub test()
Application.DisplayAlerts = False
ActiveWorkbook.FollowHyperlink Address:=Cells(5, 8), NewWindow:=True
Application.DisplayAlerts = False
End Sub
And this is the Macro Recorded Code:
Code:
Sub Macro4()
'
' Macro4 Macro
' Macro recorded 3/7/2008 by Authorized User
' Range("H4").Select
Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True
Workbooks.Open Filename:="[URL unfurl="true"]http://new/subscriptions/RQ_49480.csv"[/URL]
ActiveWindow.Visible = False
Windows("RQ_49480.csv").Visible = True
End Sub