Dec 06 2022 01:36 PM
Hi,
A power shell script is opening an excel file where on opening the file it is set to an automatic data refresh and at last script closes the file. I wrote a simple macro to auto-save the file before file get closed, after watching a tutorial.
I am very new, can you please help me with VBA, the expression error alert comes (PFA) when we open the excel file, just need a VBA code in addition to the existing code which gives application.displayalerts=False on opening the file and keep the file running so data refresh can run, and later follow the existing VBA (PFA) to save the file before closing.
Hope I am clear. Kindly suggest.
Display alert on opening the excel file using Power Script
Current VBA to save the file automatically before closing the file
Dec 07 2022 01:12 AM
Your VBA code runs when the workbook is closed, but the error occurs when the workbook is opened, so it must be caused by code that runs then.