Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
SUMPRODUCT with criteriya 5 25
Macro Capitalize 4 51
Excel partial font macro 14 25
change VBA to show result in cells rather than debug.print 4 34
Introduction This Article briefly covers methods of calculating the NPV and IRR variants in Excel as well as the limitations in calculating and interpreting IRR results. Paraphrasing Richard Shockley, author of my favourite finance reference tex…
VALIDATING DATES One method of validating dates is to jam the date into the DATE command and see if it accepts it by examining the system's errorlevel value. A non-zero result indicates failure. A typical example might look something like the fol…
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
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 …

943 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

6 Experts available now in Live!

Get 1:1 Help Now