Solved

Excel Native Format with VBA

Posted on 2013-01-22
2
271 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 92

Expert Comment

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

Accepted Solution

by:
Patrick Matthews earned 250 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

737 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