Solved

VB.net 2005 save Excel 2007 file to Excel 2003 file

Posted on 2010-08-26
3
630 Views
Last Modified: 2013-12-06
I have a vb.net 2005 program that cretaes an excel file

The machine I'm running it on has Windows 7 with Office 2007.

The problrem is, i want the Excel file saved as an .xls file, but it saves it as a .xls file

The clients that will use the reulting output file use machines that are running XP w/ Excel 2003.

I know there are compatibility packs, but I don' twant them to have to open it, then 'save as" and
 have several copies of the file, etc.

Here's the statesments I'm using to declare the excel file:

Dim wb As Excel.Workbook
Dim ex As New Excel.Application
wb = ex.Workbooks.Add
wb.SaveAs("OutputFile"))


The reult of this code is OutputFile.xlsx

What i would like to have is OutputFile.xls

Any help would be greatly appreciated.

Thanks!!
0
Comment
Question by:PSERSRH
  • 2
3 Comments
 
LVL 92

Accepted Solution

by:
Patrick Matthews earned 500 total points
Comment Utility
Try specifying the file type.  If this is running in Excel 2007:        wb.SaveAs "OutputFile.xls", 56Patrick
0
 

Author Comment

by:PSERSRH
Comment Utility
That worked!! Thank You So Much Patrick!!

I search high and low online, with every possible combination of wording, it was nowhere to be found.

You save my day!

Thanks again!

Robert
0
 
LVL 92

Expert Comment

by:Patrick Matthews
Comment Utility
Glad to help :)
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
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 …
This Micro Tutorial will demonstrate in Microsoft Excel how to add style and sexy appeal to horizontal bar charts.
This Micro Tutorial will demonstrate how to create pivot charts out of a data set. I also added a drop-down menu which allows to choose from different categories in the data set and the chart will automatically update.

743 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now