Solved

Saving Excel Spreadsheet

Posted on 2003-10-28
6
266 Views
Last Modified: 2008-02-01
I need help, this is kind of a continuation of another question, that I has not fully been resolved.  I have created an application that creates a report.  It works perfect on the development machine, but will not save the spreadsheet on a differerent machine.  The difference is the development machine has excel 2002 and the other machine has excel 2000. I am using

xlApp.Application.Workbooks(1).SaveAs("C:/test.xls") and this is where the problem is.

Is there anyway of getting this to work, I need help.  

here is the link to more info on the topic, I am dealing with.

Thanks

http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/Q_20780057.html#9633334
0
Comment
Question by:dkilby
6 Comments
 
LVL 4

Accepted Solution

by:
NetPointer earned 500 total points
ID: 9637015
Give a try to this....

Dim oStr as Object
dim strFile as String = "C:/test.xls"

oStr = strFile
xlApp.Application.Workbooks(1).SaveAs(oStr)
  OR
xlApp.Application.Workbooks(0).SaveAs(oStr)

Regards,
NetPointer
0
 

Author Comment

by:dkilby
ID: 9637099
ixlApp.Application.Workbooks(1).SaveAs(oStr) is the way I had it to start with but I changed to by putting the fileName in.  What is the difference between having the 0 or the 1 after workbooks?
0
 
LVL 4

Expert Comment

by:NetPointer
ID: 9637846
just in case u dont have the work book with index 1 and only 0...

Regards,
NetPointer
0
 
LVL 2

Expert Comment

by:wellilein
ID: 9641584
If you want saving in a previous format, try
ActiveWorkbook.SaveAs Filename:= "c:\test.xls", FileFormat:=xlExcel9795

xlApp.Application.Workbooks(0).SaveAs Filename:= "c:\test.xls", FileFormat:=xlExcel9795
might work also.
By the way I only found the constant xlExcel9795, not something like xlExcel2000.
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 10232179
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

Accept: NetPointer {http:#9637015}

Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

TheLearnedOne
EE Cleanup Volunteer
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

IP addresses can be stored in a database in any of several ways.  These ways may vary based on the volume of the data.  I was dealing with quite a large amount of data for user authentication purpose, and needed a way to minimize the storage.   …
Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

705 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