Problem Saving File As Current Format

A

Alan

Using VBA in Excel 2007, I open up an existing file that is in
Excel 2003 format (FileFormat = 56) and try to save it under another
name but with the same format as the original. However, I get the
followig error:

Runtime error '1004':
Method 'SaveAs' of object '_Workbook' failed

I am using the following code to do this:

ActiveWorkbook.SaveAs Filename = Location, FileFormat =
ActiveWorkbook.FileFormat

so it will work with whatever the original file format is.

Am I doing something wrong?

Thanks, Alan
 
D

Doug Robbins - Word MVP

There should be a colon after Filename and FileFormat

Better to post to microsoft.public.excel.programming as this group is for
the use of vba with Word.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 

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