I have a workbook that I am making copies of and saving those copies as different names.
For some reason, what appears to be random, some of the files don't get the .xlsx extension added to the saved file.
The files are being saved with the correct name convention I setup, but the file extension is being dropped.
They are being saved in the correct location just fine.
So I will go into the directory and see files with the xlsx icon and a xlsx file extension. The type is even listed as: Microsoft Excel Worksheet. Yet, some random files have no icon (just blank, appears like a white sheet of paper), and the Type is listed as: File.
If I manually add the .xlsx extension then the icon appears (after a refresh) and the file opens just fine.
I can't figure out why it is dropping the file type extension when saving. I can't determine a pattern.
Any thoughts?
Here is the code I am using:
Is there something wrong with how I am declaring the fileformat?
Maybe I should do something like:
Or perhaps something like:
Although, as I understand it, they should all do the same thing, right?
I am stumped .....
-Spydey
For some reason, what appears to be random, some of the files don't get the .xlsx extension added to the saved file.
The files are being saved with the correct name convention I setup, but the file extension is being dropped.
They are being saved in the correct location just fine.
So I will go into the directory and see files with the xlsx icon and a xlsx file extension. The type is even listed as: Microsoft Excel Worksheet. Yet, some random files have no icon (just blank, appears like a white sheet of paper), and the Type is listed as: File.
If I manually add the .xlsx extension then the icon appears (after a refresh) and the file opens just fine.
I can't figure out why it is dropping the file type extension when saving. I can't determine a pattern.
Any thoughts?
Here is the code I am using:
Code:
.....
ActiveWorkbook.SaveAs filename:=strPath & strFileName, FileFormat:=51
.....
Is there something wrong with how I am declaring the fileformat?
Maybe I should do something like:
Code:
.....
strFileName = Tracking(i, 1) & " - " & Tracking(i, 2) [B]& ".xlsx"[/B]
ActiveWorkbook.SaveAs filename:=strPath & strFileName
.....
Or perhaps something like:
Code:
.....
ActiveWorkbook.SaveAs filename:=strPath & strFileName, FileFormat:[COLOR=#333333][FONT="]xlOpenXMLWorkbook[/FONT][/COLOR]
.....
Although, as I understand it, they should all do the same thing, right?
I am stumped .....
-Spydey