COM object in cell?

  • Thread starter Thread starter Thomas Baier
  • Start date Start date
T

Thomas Baier

Hello experts,

I'd like to associated a COM object (containing structured data) with a
specific cell. The cell should display a text to indicate there is a COM
object and the context menu of the cell should show specific menu items (if
possible).

The main idea is, that this COM object contains additional data for the
spread-sheet and this data should automatically be saved with the XLS and
loaded again.

How can this be achieved?

Thomas
 
an object would be stored above the cells - rather than in them. There
would be no way to automatically place data in the cell unless you make a
provision to link to the cell - I don't know how to do that, but I believe
there was a KB article on doing it if it still exits.

In Excel 2002 and beyond, you can make a special type of com addin that
provides functions that can be used in a cell - perhaps that is what you
want to do. There is information in the KB showing how. In Excel 2000, you
can use a regular com addin, but have to have vba wrapper functions I
believe. Again, the KB has details.

http://support.microsoft.com search on Excel and com addins in the
knowledge base.
 
Dear Tom,

Tom Ogilvy said:
an object would be stored above the cells - rather than in them. There
would be no way to automatically place data in the cell unless you make a
provision to link to the cell - I don't know how to do that, but I believe
there was a KB article on doing it if it still exits.

thanks for your answer. Does this "above the cells" mean, that it is stored
in some
other location (e.g. in the OLEObjects collection)?

Can I then call a VBA function from this COM object (I think I could just
create a simple Active X control wrapping my data object and providing
the ability to call a VBA function by chosing an item from the context
menu)
 
Not my area of expertise, but yes, it would be in the OLEObjects collection
similar to the MS Forms 2.0 controls. How and if the OleObject could
interact with the Excel host application, I can not say. The MS Forms 2.0
controls seem to be able to interact with Excel such as linking to cells so
I suspect it is possible.
This article talks about limitations of activeX in Excel/office documents:

http://support.microsoft.com/default.aspx?scid=kb;en-us;168392
OFF97: Limitations of ActiveX Control Support in Office Document

This article has some information on an activeX control getting information
from the host. It also has some links for related information (including
the above).
http://support.microsoft.com/default.aspx?scid=kb;en-us;266318&Product=ofw2k
HOWTO: Retrieve the Name of an Office Document That Contains an MFC ActiveX
Control

http://support.microsoft.com/default.aspx?scid=kb;en-us;271736&Product=xlw
HOWTO: Add Excel LinkedCell Support to Your ATL ActiveX Control

Some information you may want later:
http://support.microsoft.com/default.aspx?scid=kb;en-us;185473&Product=ofw2k
PRB: Changes to Custom ActiveX Control Are Not Used

Don't know if any of these will be helpful, but perhaps they will give you
some insights.
 

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

Back
Top