Solved

Saving Excel Spreadsheet

Posted on 2003-10-28
6
295 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 our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

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

Suggested Solutions

A basic question.. “What is the Garbage Collector?” The usual answer given back: “Garbage collector is a background thread run by the CLR for freeing up the memory space used by the objects which are no longer used by the program.” I wondered …
In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

821 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