Gerald Higgins
Well-known Member
- Joined
- Mar 26, 2007
- Messages
- 9,258
I've been using Excel 2003 until last week, when I got switched to 2007.
My colleagues are still all on 2003.
I have a macro that has been running fine in 2003, but testing it in 2007 it now falls over.
It does a number of things, but at the point where it falls over, it is saving the single current worksheet of the current multi-sheet workbook, as a standalone file, with a single sheet.
This code works in 2003....
but it falls over in 2007, with an error message of
I'm guessing this is because 2007 doesn't like me saving it in xlExcel4 format, and when I try to do it manually, I can't find that option on the Save As menu.
So, QUESTION, does anyone know what code I could use to achieve the same result, and preferably for it to work in BOTH 2003 AND 2007 ?
Thanks in advance for any help . . .
My colleagues are still all on 2003.
I have a macro that has been running fine in 2003, but testing it in 2007 it now falls over.
It does a number of things, but at the point where it falls over, it is saving the single current worksheet of the current multi-sheet workbook, as a standalone file, with a single sheet.
This code works in 2003....
Code:
ActiveWorkbook.SaveAs Filename:= "C:\Filename.xls", FileFormat:= xlExcel4
but it falls over in 2007, with an error message of
Code:
Run time error '1004'
Method 'Save as' of object '_Workbook' failed
I'm guessing this is because 2007 doesn't like me saving it in xlExcel4 format, and when I try to do it manually, I can't find that option on the Save As menu.
So, QUESTION, does anyone know what code I could use to achieve the same result, and preferably for it to work in BOTH 2003 AND 2007 ?
Thanks in advance for any help . . .