Forum Discussion
alex kramer
Jan 04, 2018Copper Contributor
Need to edit a VBA script that automatically closes Excel
I have an Excel XLSM that is invoked by Windows Task Scheduler at a specific time each week. It updates a worksheet, saves a report (using "save as PDF"), closes the workbook and then exits Excel. Ho...
Haytham Amairah
Jan 04, 2018Silver Contributor
Alex,
You have to disable that macro somehow to be able to open that Excel file and get access to the macro code.
To do that, open a blank Excel workbook, then go to File >> Options >> Trust Center >> Trust Center Settings >> Macro Settings , or press Alt+T+M+S respectively.
Then make sure that the option (Disable all macros with notification) is selected.
In the same Trust Center dialog box select Trusted Documents, and click Clear button.
After that, find that Excel file and open it (Do not enable macros if you are prompted to do so), then press Alt+F11 to open the VBA editor, find the macro code and edit it as you want.
Isoy1945
Aug 13, 2023Copper Contributor
This just saved me, thanks a lot Haytham Amairah