Can somebody please help to identify what mistake am i committing? I'm using Excel 2010
Running macro gives me the message that...
Run time error 1004
Method 'SaveAs' of object' _workbook' failed
Here is how I set up the file format
If Val(Application.Version) < 12 Then
FileExtStr = ".xls": FileFormatNum = -4143
Else
FileExtStr = ".xlsm": FileFormatNum = 52
End If
Here is my code:
.SaveAs TempFilePath & TempFileName & FileExtStr, FileFormat:=FileFormatNum
Running macro gives me the message that...
Run time error 1004
Method 'SaveAs' of object' _workbook' failed
Here is how I set up the file format
If Val(Application.Version) < 12 Then
FileExtStr = ".xls": FileFormatNum = -4143
Else
FileExtStr = ".xlsm": FileFormatNum = 52
End If
Here is my code:
.SaveAs TempFilePath & TempFileName & FileExtStr, FileFormat:=FileFormatNum