 |
guyt Level: Guest

|
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 |
|
|  |
|
|
guyt Level: Guest

|
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 |
|
|  |
|
|
|
|
 |
 |