Dave Evans
asked on
ActiveWorkbook.SaveAs in /TMP?
Please forgive what may be astonishing ignorance.
On a PC, it works, but I can't get it to work on a Mac - Goal is to save a temporary Excel with macros file (so it will be deleted thereafter) with a standardized name for emailing. I'd like to do so in the TEMP directory. Here it is for the PC:
ActiveWorkbook.SaveAs Filename:=Environ("temp") & "\" & Range("J112").Text & " - MCR " & Range("D112").Text, _
FileFormat:=52, CreateBackup:=False
I've tested various combinations without success. What to do?
Thanks!
On a PC, it works, but I can't get it to work on a Mac - Goal is to save a temporary Excel with macros file (so it will be deleted thereafter) with a standardized name for emailing. I'd like to do so in the TEMP directory. Here it is for the PC:
ActiveWorkbook.SaveAs Filename:=Environ("temp") & "\" & Range("J112").Text & " - MCR " & Range("D112").Text, _
FileFormat:=52, CreateBackup:=False
I've tested various combinations without success. What to do?
Thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Without additional information from the OP, this is the most succinct answer available.
then when you step through your code, you can inspect the actual value of your MyFilename variable before the error hits...
Also when adding cell content to a filename you should consider error handling for illegal characters
I always use a function for that (that I found here on EE)
Open in new window