Excel 2003
I have a macro that opens a CSV file and removes a few columns and rows and then saves the new file as an .XLS . At least that is what I want it to do. It continues to fail on the save part of the macro.
If I run this macro on a PC with excel 2013 it works fine. And I can take a copy of the new file and open it on the excel 2003 PC and it opens fine. I don't want to keep running the macro on one PC and move the resulted file to the other PC.
Here is my code:
I have also tried:
Tried this one but no luck:
I have tried changing the format number and tried it without the FileFormat:= altogether but nothing helps.
Am I using the wrong number?
I have a macro that opens a CSV file and removes a few columns and rows and then saves the new file as an .XLS . At least that is what I want it to do. It continues to fail on the save part of the macro.
If I run this macro on a PC with excel 2013 it works fine. And I can take a copy of the new file and open it on the excel 2003 PC and it opens fine. I don't want to keep running the macro on one PC and move the resulted file to the other PC.
Here is my code:
Code:
Application.DisplayAlerts = False 'IT WORKS TO DISABLE ALERT PROMPT
ActiveWorkbook.SaveAs Filename:="C:\ABC\Inventory" & ".xls" _
, FileFormat:=56, CreateBackup:=False
Application.DisplayAlerts = True 'RESETS DISPLAY ALERTS
ActiveWindow.Close
Code:
Application.DisplayAlerts = False 'IT WORKS TO DISABLE ALERT PROMPT
ActiveWorkbook.SaveAs Filename:="C:\ABC\Inventory.xls" _
, FileFormat:=56, CreateBackup:=False
Application.DisplayAlerts = True 'RESETS DISPLAY ALERTS
ActiveWindow.Close
Code:
Application.DisplayAlerts = False 'IT WORKS TO DISABLE ALERT PROMPT
ActiveWorkbook.SaveAs Filename:="C:\CER\Inventory" & ".xls" _
, FileFormat:=xlExcel8, CreateBackup:=False
Application.DisplayAlerts = True 'RESETS DISPLAY ALERTS
ActiveWindow.Close
Am I using the wrong number?