Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Excel WorkbookBeforeClose ___ 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel Workbook Close Event__ Documentation Proof needed. [email protected] Excel Programming 0 June 4th 08 03:29 PM
Excel 2003 default file location always jump to .....\Proof Help Edmond Kong Excel Discussion (Misc queries) 0 November 19th 07 04:02 AM
I need complete idiot proof excel setup database help. please MadMoose New Users to Excel 6 April 13th 06 03:32 PM
WorkbookBeforeClose problem Frederick Chow Excel Programming 3 March 22nd 06 05:44 PM
Look up VBA documentation using Excel Help Wellie Excel Programming 2 June 8th 04 11:20 PM


All times are GMT +1. The time now is 06:59 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"