SaveAs Type Problem

N

Nigel

Hi All
Curious issue has arisen with xl2007 (SP1); I am creating a new workbook
based on a template file (xlt) that was created using xl2003 (SP3). The new
workbook is created and assigned to a workbook object wbTemp.Which I then
wish to save in xl2003 format.

I tried without success both of the following....

wbTemp.SaveAs Filename:="D:\Test.xls", FileFormat:=xlExcel9795

wbTemp.SaveAs "D:\Test.xls", xlExcel9795

When run it I get Run-time error 1004 - Method of 'SaveAs' of object
'_Workbook' failed

What is wrong?

PS if I remove the FileFormat parameter it works but of course the format
reverts to xl2007 with an xls extension!
 
N

Nigel

Hi Bob
I tried all combinations with and without the xls extension without success,
I tried file formats xlExcel8 as well as xlExcel9795 and still no joy, I
tried using the enumeration values for these 43 and 56 again without
success.

In desperation I recorded the file save process and modified as follows, it
now works.

wbTemp.SaveAs filename:=sTemp, FileFormat:=xlExcel8, _
Password:="", WriteResPassword:="", ReadOnlyRecommended:=False, _
CreateBackup:=False

If I remove the parameters after FileFormat it fails. I thought these were
optional?

Cheers

--

Regards,
Nigel
(e-mail address removed)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top