Solved

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

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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

Ransomware continues to be a growing problem for both personal and business users alike and Antivirus companies are still struggling to find a reliable way to protect you from this dangerous threat.
You need to know the location of the Office templates folder, so that when you create new templates, they are saved to that location, and thus are available for selection when creating new documents.  The steps to find the Templates folder path are …
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …
This Micro Tutorial demonstrates in Microsoft Excel how to consolidate your marketing data by creating an interactive charts using form controls. This creates cool drop-downs for viewers of your chart to choose from.

726 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