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 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
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
Close Workbook in Excel Brenda from Michigan[_2_] Excel Discussion (Misc queries) 3 February 6th 09 06:32 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
Close workbook/excel Mike Excel Programming 3 April 22nd 05 08:27 AM
How do I? Get Excel to do something when I close a workbook emu_tails Excel Programming 2 October 12th 03 08:04 PM


All times are GMT +1. The time now is 04:15 PM.

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

About Us

"It's about Microsoft Excel"