Using the Microsoft Spreadsheet Control as ActiveX

  • Thread starter Thread starter Lawrence
  • Start date Start date
L

Lawrence

Hi

I am using the Microsoft Office Spreadsheet component
which is in the Microsoft Office XP Web Components type
library.

I have this activex as a control on a form. I cannot work
out how to load data from an disk file, say "data.xls"

I would apprecaite some assistance.

lawrence
 
I have the same problem. I've looked all around, and apparently there is no
way for the spreadsheet control to load/save .XLS files programmatically.
You can, of course, use the control's toolbar to manually export the
control's data to Excel, and save from there. But I don't think you can do
the reverse.

I got around this by using .XML files instead of .XLS files. I created a
"template" spreadsheet in Excel and saved it as a .XML file from there.
Then, I use the XMLURL property of the spreadsheet control to load the file,
make my changes, and then use the Export method (with the
ssExportXMLSpreadsheet format option) to save it. It works for me because
Excel can also read/write XML files.

HTH,

Carl Rapson
 
Thanks for the update.

What I did was I used the SaveAs property of the Excel COM object and
created the XMLSpreadsheet on the fly.

Then I used the XMLURL property to load the xml.

Thanks for the assistance

Lawrence
 
Back
Top