Solved

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

Posted on 2010-08-26
3
660 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
ID: 33535210
Try specifying the file type.  If this is running in Excel 2007:        wb.SaveAs "OutputFile.xls", 56Patrick
0
 

Author Comment

by:PSERSRH
ID: 33535646
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
ID: 33535685
Glad to help :)
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

Being a system administrator some time we require to do things remotely, one of them is installing software. Here I am going to tell you how to install software through wmic (Windows management instrument console). I am not at all saying that this i…
Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…
Graphs within dashboards are meant to be dynamic, representing data from a period of time that will change each time the dashboard is updated with new data. Rather than update each graph to point to a different set within a static set of data, t…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

861 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