Good afternoon,
I have a macro (below) that I use for work often; it takes a specific sheet, copies it into a new file as values only, saves it in a file location, and moves on to the next sheet.
A piece of the macro is as follows (it repeats ~40 times with different Client names):
and repeat with the next client in the list. The tabs are ordered and the names match identically. We have used this macro for years. Now when running, I receive the rather generic:
Run-Time error '1004':
Method 'SaveAs' of object '_Workbook' failed
Other queries of this same error haven't proven too useful as everyone seems to use the SaveAs part differently and I'm not terribly experienced with macro syntax to make sense of it and I'm hoping someone here can help. The debug option highlights the following as the issue:
"F:\Corporate Reports\CLIENT\2020\12.31.20 LB Report - CLIENT.xlsx" _
, FileFormat:=xlOpenXMLWorkbook, CreateBackup:=False
To make this more interesting, after I've run the macro (remember, there are 40ish of the above code chunks, rinse and repeat style), the previous one works (I can open the file and everything) and it fails on the next. Once I've run the macro ~40 times, it then can go all the way through with no errors? It seems to be per workbook though, as we use this style macro in several books and I really don't want to have to run this 40 times every month when I have a new batch to save.
Bookmarks