Suppressing Office popup when trying to open pdf via excel macros

Frequent Visitor


(Not an expert at Excel or VBA, by any stretch, but can muddle my way through)


I have to create 1000+ forms for individual users and when opening a PDF using macros, a dialog pops up warning something like



Opening ABC.pdf


Some files can contain viruses ...


Would you like to open this file?



It is annoying to sit click OK every time this shows up. Is there any way to suppress this popup, to automate the file filling/creation?


Kinda urgent.



1 Reply
Perhaps try Application.DisplayAlerts=False right before you open the documents.

Just be sure to turn it back on. Otherwise, it will also suppress the "do you want to save changes" before closing your workbooks, also.