I have a script that builds an HTML file then launches the html file in the active browser and each time it runs there is a warning message that pops up. The HTML file does not contain any active content, so I'd like to know how to eliminate this particular error, and not because I'm too lazy to click the "Yes" button but because my mouse is configured to change focus to the window that it is over. This causes the warning message to quickly move to the background unless my mouse happens to be over the place where this warning shows up but even then, sometimes it becomes unreachable.
The VBA code is halted at this point until I can acknowledge the message, and this is not always possible since when this message moves to the background, for some reason it does not always appear as an available window to switch to. Excel just beeps at me when I try and do anything since the code is halted until I acknowledge the message. I've had to end the Excel task and potentially lose any data on a few occasions.
The other reason I'd like to eliminate this message is that by the time the message appears, the HTML file is already open in the browser and any potential damage would have already be done.
In testing, any HTML file could be placed in the user's Documents directory and named CS_GoogleMaps.html, an example of the one I use is attached as a text file. My hope is that there is possibly a way to map the file to a trusted location or trust this and all files derived from this template, or to some other way to get around the useless warming.
The code I use that causes the warning is below, and the actual culprit is the ActiveWorkbook.FollowHyperlink line near the very bottom:
Bookmarks