Solved

Excel Native Format with VBA

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

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
Workbook link problems after copying tabs to a new workbook? David Miller (dlmille) Intro Have you either copied sheets to a new workbook, and after having saved and opened that workbook, you find that there are links back to the original sou…
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.

717 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