Excel Add-In using COM / Ole Automation

G

gswatton

I'm tasked with a project to develop an Office Add-In for (Word, Excel, and
Powerpoint). I have to use C++ and COM / Office automation to perform the
project, since I'm integrating another C++ library. I have the basic
functionality I'm looking for working within Word, but I'm running into
multiple roadblocks with Excel. Powerpoint will be next.

I've managed to be able to create an add-in and add a button bar and hook up
the events, get the Application (CComQIPtr<Excel::_Application>), active
workbook (CComPtr<Excel::_Workbook>), and active
worksheet(CComPtr<Excel::_Worksheet>. However, I'm having a very difficult
time trying to navigate the worksheet and parse the ranges within Excel.

Specifically, I would like to get API documentation (if it exists) and
samples for the following operations:

1. Get the current Excel Selection. I think this is
Application->get_Selection(), but I'm not sure what it returns as a IDispatch
**RHS, or what I should pass for the LCID?

2. Parse and read the data from the Cells within the Selections.

3. Replace the data in the Cells within the current Selections.

4. Store a binary object within a Cell in the worksheet.

I've seen many examples using VB, but as stated before this is not an
option. I'm NOT an expert at COM / OLE / Automation, so this adds to the
challenge. I can view the COM interfaces with OleView, but I don't know what
methods to use to perform what I'm trying to do.

Thanks in advance for whatever help you can provide.
 

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