r/vba • u/Available-Peach-7013 • 12d ago
Unsolved How to preview macro-enabled files?
The previewer in file explorer only shows a blank preview for macro-enabled Excel files, no warning message, just blank. I installed the latest Windows update where you can click on "Show preview anyway", but this only works for pdfs, not for macro-enabled Excel files. Does anyone know a solution for this?
2
Upvotes
1
u/decimalturn 12d ago
I'm assuming that the preview is blocked for "security reasons", but they could just extract the XML structure to render the preview, so Microsoft could work around it if they wanted. I doubt they will however.
You could use a PowerToys Explorer add-on to create your own preview renderer, but that might be a bit too involved.
2
u/ZetaPower 12 12d ago
Easy you can open them without auto starting code.
Step 1 unlock the file.
Step 2
You MUST follow this route! Every other route will let code auto run!
The file is now opened and the code can be inspected.
Go to the VBA, check if there is auto run code in Workbook: Workbooks.Open or in a Sheet Sheet_Change
If there is you need to deactivate it to securely check it.
Easiest way: directly after the start of the code put in EXIT SUB. If the code fires it will immediately exit.