[Last Call] Learn how to a build a cloud-first strategyRegister Now


Simple Excel 2007 VBA Enum question

Posted on 2010-01-05
Medium Priority
Last Modified: 2012-05-08
The following causes an error in Excel 2003 but works in 2007:

wbk.SaveAs Filename:=sFile, FileFormat:=xlExcel8, CreateBackup:=False

What file format constant do I need to use to have this work in both 2003 and 2007?
Question by:Wicklunda
LVL 59

Accepted Solution

Saurabh Singh Teotia earned 1000 total points
ID: 26184341
Use this...

wbk.SaveAs sFile, xlWorkbookNormal

Open in new window


Assisted Solution

fhillyer1 earned 1000 total points
ID: 26184363
excel 2003 does not understands the xlExcel8 format so you need the following

if application.Version > 11 then
    wbk.SaveAs Filename:=sFile, FileFormat:=xlExcel8, CreateBackup:=False
    wbk.SaveAs Filename:=sFile, FileFormat:=xlWorkbookNormal, CreateBackup:=False
End if

Open in new window


Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.

825 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question