Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Excel Workbook Close Event__ Documentation Proof needed.
Hi All,
I need a documentation proof for the following observation i have made(presuming my observations are correct :) ) I have written a addin for Microsoft Excel. This addin handles the CLOSE event from the Excel. But now , I have a Macro in an Excel sheet which is also listening for the close event.(the macro is as below) Private Sub Workbook_BeforeClose(Cancel As Boolean) If MsgBox("Confirm exit", vbYesNo) = vbNo Then Cancel = True End If End Sub And in the Addin , i am using the Cancel parameter as below. OnWorkbookBeforeClose(IDispatch* pWorkbook, VARIANT_BOOL* pbCancel) { //So here pbCancel value is depending on what is clicked in that message box -- // As it is seen Message box has two buttons "Yes" and "No" // If "No" button is clicked , the Cancel parameter value we get is "True" // If "Yes" button is clicked, the addin does what is intend it to do. (i:e it closes the Excel) } As it is understood This macro pops up a message box and can alter the "cancel" depending on what is clicked. And in the Addin, what i get now is the edited value of the "Cancel" parameter if "NO" button is clicked. So, what i am assuming is, THE EVENT FIRST GOES TO THE MACRO AND ONLY THEN COMES TO MY ADDIN. So, is my assumption Correct, if so , can i have some Documentation proof for the same(i:e - The control goes to the macro first and then will be sent to the Addin's (if any)) So, has any one come across the same situation. It would be of great help if you reply me on this. Thanks in Advance. Naveen |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Close Workbook in Excel | Excel Discussion (Misc queries) | |||
Excel 2003 default file location always jump to .....\Proof Help | Excel Discussion (Misc queries) | |||
I need complete idiot proof excel setup database help. please | New Users to Excel | |||
Close workbook/excel | Excel Programming | |||
How do I? Get Excel to do something when I close a workbook | Excel Programming |