Reading data from an existing Excel file

C

Chris H

I have added Microsoft Office Spreadsheet 11.0 to my COM Components In
Visual Studio 2008 MFC program and then added a Microsoft Office Spreadsheet
11.0 'item' to a dialog and went with the default name IDC_SPREADSHEET1 for
now. Now how do I
access the Spreadsheet through my program? I found a VBA example that does
what I need to do. In the VBA example they use commands like:

TempURL = "c:\Gen X Recipes\" & ComboBox1.Text

Spreadsheet1.HTMLURL = TempURL

UserForm1.Spreadsheet1.Height = 462

UserForm1.Spreadsheet1.Width = 588



UserForm1.Spreadsheet1.Cells(13, 3).Value = LastLength


Spreadsheet1 comes up as undefined and obviously I don't have a VBA style
UserForm1 in a MFC program.



I have found some examples that use other compilers or Microsoft Office
components (Power Point) that I am not familiar with. They all seem to
calling Initialize, CoInitialaize or declaring some kind of object. I can
not find the common pattern and from what I read this changes with every
version of Microsoft Office. I am sure it is all obvious once you know but I
am LOST on how to START.



I am not even sure that owc11.exe supplies what I need to work with
Microsoft Office Excel 2007.

More generally where can I find documentation for using Microsoft Office
Spreadsheet 11.0 component?


Thanks In Advance

Chris
 

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