Solved

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

Posted on 2010-08-26
3
654 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
.Range Set 25 79
Excel - Data Validation 3 31
Want to Compare Ratings by group of tier's stuck in the process 1 19
excel formula to sum column 13 17
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…
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…
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.

831 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