I have a spreadsheet that updates about 50 queries via a linked data source. I created an automatic macro for "on worksheet open" and the macro refreshes all connections, recalculates, saves some pdf's of the values and then quits without saving. The issue isn't getting this process to work... The issue I am having is getting this process to work when I call the spreadsheet from a batch script.
I call it by using:
"c:/full/path/to/excel/excel.exe" /r "c:/spreadsheet/path/here/spreadsheet.xlsm"
(I have also tried without the read only switch)
When I double click the spreadsheet, it works fine, opens, refreshes, saves pdfs, exits without saving.
When I call from a command line (batch file), it opens, refreshes, takes exactly the same time as when opened manually but the data is different (wrong) on the pdf files that it saves.
Anyone have any clue what might be going on here or what to troubleshoot next?
(Excel 2010, Windows 2008 R2 OS)
Bookmarks