freybe06
02-12-2013, 09:18 AM
Hi Everyone,
I know there are a million different posts about this error (and I've ready a ton of them) but nothing seems to solve the issue I'm having...
I want to save a file but every time the macro ends, the new file is named "False" and it doesnt have an extension.
Here is the code:
With ActiveWorkbook
Sheets.Copy
ActiveWorkbook.SaveCopyAs Filename = _
"H:\My Documents\Work\Work Automations\PHD\" & "PHDOutput" & ".xls"
ActiveWorkbook.Close False
.Activate
End With
Like I said, the macro does save a new file to the My Documents\...\ folder, but the document name is "FALSE" with no extension. I double-clicked on the file and manually put ".xls" at the end and it opened fine with all the data I needed inside.
Thanks in advance!
I know there are a million different posts about this error (and I've ready a ton of them) but nothing seems to solve the issue I'm having...
I want to save a file but every time the macro ends, the new file is named "False" and it doesnt have an extension.
Here is the code:
With ActiveWorkbook
Sheets.Copy
ActiveWorkbook.SaveCopyAs Filename = _
"H:\My Documents\Work\Work Automations\PHD\" & "PHDOutput" & ".xls"
ActiveWorkbook.Close False
.Activate
End With
Like I said, the macro does save a new file to the My Documents\...\ folder, but the document name is "FALSE" with no extension. I double-clicked on the file and manually put ".xls" at the end and it opened fine with all the data I needed inside.
Thanks in advance!