Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How to catch excel events form C++ program? I have no idea?
Here is my code, I can connect to excel, create new workbook, but how to connect my handler to Excel event? HRESULT BeforeSave (VARIANT_BOOL SaveAsUI, VARIANT_BOOL *Cancel) { MessageBox(NULL, "Hello fro beforesave", "zzz", MB_OK); *Cancel = false; return 0; } { _ApplicationPtr pXL; try { pXL.CreateInstance(L"Excel.Application"); pXL-Visible = VARIANT_TRUE; pXL-EnableEvents = true; WorkbooksPtr pBooks = pXL-Workbooks; _WorkbookPtr pBook = pBooks-Add((long)xlWorksheet); ????????? } |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I don't know anything about C++, but this article may get you started:
http://support.microsoft.com/default...83&Product=vcc HOWTO: Trap Events Exposed by Office Applications It has a reference to an article specific to Word, but that should be adaptable to Excel. -- Regards, Tom Ogilvy "j23" wrote in message ... How to catch excel events form C++ program? I have no idea? Here is my code, I can connect to excel, create new workbook, but how to connect my handler to Excel event? HRESULT BeforeSave (VARIANT_BOOL SaveAsUI, VARIANT_BOOL *Cancel) { MessageBox(NULL, "Hello fro beforesave", "zzz", MB_OK); *Cancel = false; return 0; } { _ApplicationPtr pXL; try { pXL.CreateInstance(L"Excel.Application"); pXL-Visible = VARIANT_TRUE; pXL-EnableEvents = true; WorkbooksPtr pBooks = pXL-Workbooks; _WorkbookPtr pBook = pBooks-Add((long)xlWorksheet); ????????? } |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Responding to cell events in Excel | Excel Programming | |||
Predicting that Excel is closing using events | Excel Programming | |||
Trap Excel events from VB | Excel Programming | |||
Consuming excel events in C# | Excel Programming | |||
logging excel events? | Excel Programming |