Hi all
I'm creating a new worksheet using Excel 2007 and then i save it to file. How would i be able to specify the format to be compatible with Excel 2003?
Printable View
Hi all
I'm creating a new worksheet using Excel 2007 and then i save it to file. How would i be able to specify the format to be compatible with Excel 2003?
Hey MP hows it going? Long time no post lol.
Just open the workbok and raise the .SaveAs passing "xlExcel8" as the FileFormat argument.
Hi Rob,
for some reason it crashes when i try that. It works if I try xlWorkbookNormal, but if i try xlExcel8 it throws:
{System.Runtime.InteropServices.COMException (0x800A03EC): Exception from HRESULT: 0x800A03EC
any ideas? :confused:
Running any plugins in Excel 2007? Sounds like one of them crashed or didn't respond too well to the command
I dont have 2007 at this location so I can check it tonight.
nope it's a plane installation
Hi,
You don't by any chance have something like Acrobat installed do you?
Sam
hmm yea i have acrobat reader... why?
Funny thing is using this format works fine: xlExcel9795
Is there any particular reason why that version would work and excel 8 wouldnt work? is there any downside in using the older 9795 version?
edit: uuh okay i tried xlExcel9795 on another computer that has office 2007 installed on it, and it throws that exception. It runs fine on the computer that has office 2003 installed on it :confused:
this works so far, but it seems more like a "hack" to me... anyone can tell me why this is failing depending on what version of office I'm running?
(yea that's C# but it looks 'near' identical in VB :D)PHP Code:if (app.Version == "11.0")
format = Excel.XlFileFormat.xlWorkbookNormal; //This format would throw an exception if the machine has office 2007
else if (app.Version == "12.0")
format = Excel.XlFileFormat.xlExcel8; //This would throw an exception if we're running office 2003
Hi,
In Office 2003, you can save as:
- 2003
- 2002
In Office 2007 you can save as either:
- 2007 (docX) file
- 97-2003 (doc file)
So saving in 2007 it is at lowest 8 and at highest 11, try saving as either ver 8 or ver 11.
My theory about Acrobat was just an instability but it seems more of an Office issue.
Office 2007 treats all backward compatible documents as the same class unlike Office 2003 (although if you have Office 2007 on the same it changes behaviour).
You will have to use your hack
aah i see
well thanks for your help!
hopefully this works fine for now