I have quite an interesting problem. I have an XLSM spreadsheet with an Auto_Open macro that imports data from a CSV file and does some deletion/formatting. It then saves that sheet back over the existing CSV file. I then want to resave the workbook over the existing XLSM file. If Excel 2007 is closed before the macro runs, I get "Runtime error '1004': Cannot access 'Computer Name Listing.xlsm'". However, if I run the Auto_Open macro with the workbook already open, the problem does not happen. Any ideas? The problematic section of my code is below.
If I enter debugging mode, the error line is the ".SaveAs Filename..." line.
Thanks for your help.
Bookmarks