[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 314
  • Last Modified:

Saving Excel Spreadsheet

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
dkilby
Asked:
dkilby
1 Solution
 
NetPointerCommented:
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
 
dkilbyAuthor Commented:
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
 
NetPointerCommented:
just in case u dont have the work book with index 1 and only 0...

Regards,
NetPointer
0
 
wellileinCommented:
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
 
Bob LearnedCommented:
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

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now