Hi all, first post.

I am working with excel files which get their data from htm files on the same folder location. Every time I open the xls file I get a prompt "Some of the files in this web page arent in the expected location. Do you want to download them anyway? If you're sure the web page is from a trusted source, click yes" and there are buttons for yes, no and cancel.

Is there some vba code (I am using v6) I can write which will select "Yes" when the file is being opened so I dont have to click every time?

Thanks for your help.

If this is the message popped up by Excel you can cancel that by

Dim oXL As Excel.Application

oXL.DisplayAlerts = False

after you complete you can reset by

oXL.DisplayAlerts = True

Hi Shasur,

Thanks for the reply. I think I get what you are suggesting, but the thing is I need to actually select the "yes" button which is not the default option. I think if I do what you suggest, yes it will open the file without a message but it will open with the default of "no" which is to not populate the spreadsheet with data.


Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.