Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Excel Native Format with VBA

Posted on 2013-01-22
2
Medium Priority
?
285 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
After seeing numerous questions for Dynamic Data Validation I notice that most have used Visual Basic to solve the problem. This suggestion is purely formula based and can be used in multiple rows.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

618 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