Using the Microsoft Spreadsheet Control as ActiveX

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
 
C

Carl Rapson

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
 
L

Lawrence Fisher

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



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top