borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (Find Rowws)Next Topic (How to print a spreadsheet using VB) New Topic New Poll Post Reply
AndreaVB Forum : VBA (Access, Excel, Word, ...) : Saving Excel OLE object Data to xls
Poster Message
guyt
Level: Guest


icon Saving Excel OLE object Data to xls

I have an excel ole object embedded in a visual basic form.  I'm able to write data to the embedded sheet, and graph that data to a chart.  When I use the "saveas" method, all I get is an empty spreedsheet, with no sheets or charts pressent.    

Here's the saveas code I'm using.  FrmStartup is the form.  OleTargets is the embeded spreedsheet ole object.

-----------------------------
frmStartup.oleTargets.object.SaveAs FileName:=lsPath, FileFormat :=xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:= False, CreateBackup:=False
------------------------------

In a perfect world, I'd like to be able to load, process, and analyze database and .csv data through a VB interface, then allow the user to save the completed analysis with data as an xls doc.  I'm 95% there, except for saving the data.  Any ideas?

11-03-2003 at 08:53 PM
| Quote Reply
guyt
Level: Guest

icon Re: Saving Excel OLE object Data to xls

In reference to:

frmStartup.oleTargets.object.SaveAs FileName:=lsPath, FileFormat :=xlNormal, Password:="", WriteResPassword:="", ReadOnlyRecommended:= False, CreateBackup:=False

Its been a few weeks since I've worked on this piece of code, but now I am back.  I discovered that an xls file is saved with the correct data if the code mentioned above is used.  Although, when opening the workbook through excel, the user needs to goto "Window/Unhide" in order to see anything.  

Also, if you try to record a macro in excel to see how it is done there, note that "ActiveWorkbook" should be excluded inorder for the above code to work properly.  

04-04-2003 at 01:13 AM
| Quote Reply
AndreaVB Forum : VBA (Access, Excel, Word, ...) : Saving Excel OLE object Data to xls
Previous Topic (Find Rowws)Next Topic (How to print a spreadsheet using VB) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder