?
Solved

Excel Native Format with VBA

Posted on 2013-01-22
2
Medium Priority
?
278 Views
Last Modified: 2013-01-23
I have to create a file upload from Access VBA which will export in XLS 2003. When I do CreateObject("Excel.Application"), etc, etc i get an OK looking file and the properties of the file say version 97-2003, but if you open the file in Excel, you get the 'Unrecognized format...' even though it will open.
This may break the upload, is there anyway round this or is it build into the system so you have to buy a license for making Excel files.
Maybe OLE-Automation,after file creation?
0
Comment
Question by:Silas2
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 93

Expert Comment

by:Patrick Matthews
ID: 38807906
It would be helpful to see the code you are using...
0
 
LVL 93

Accepted Solution

by:
Patrick Matthews earned 1000 total points
ID: 38807927
In any event, assuming you are running Access 2007/2010...



Dim xlApp As Object, xlWb As Object

Set xlApp = CreateObject("Excel.Application")
Set xlWb = xlApp.Workbooks.Add

' do some stuff

xlWb.SaveAs "c:\folder\subfolder\file.xls", 56
xlWb.Close False
Set xlWb = Nothing
xlApp.Quit
Set xlApp = Nothing

Open in new window


The '56' is needed to tell Excel to use the old XLS file format.  Without it, Excel will use the new OpenXML format despite the .xls extension.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

752 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