LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,514
Default Passing data to an event handler

Thank you for your prompt reply that reassured me that Public
variables work as I expected. I confirmed this by coding up a simple
test case.

Looking at my code more closely, I noticed in the event handler
Worksheet_BeforeDoubleClick the statement

Dim bref as Budget

Now, I realize this created a new local variable. Commenting out
this statement and using bref gives me the Public variable defined
in Main and thus access to the Budget data structure.

If this simple coding error had occurred in another module, I
probably would have quickly spotted it. However, having the error
only occur in an event handler led to the false assumption that
perhaps Excel's event handlers have special rules. Their interface
parameters are specified by Excel and must not be changed, but that
is all.


Glad you caught the problem! Best wishes...

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


 
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
event handler list travis Excel Programming 2 July 26th 06 02:48 PM
Event handler VBA Noob[_4_] Excel Programming 4 April 26th 06 03:49 PM
Event handler is invalid Minh[_2_] Excel Programming 2 December 8th 05 02:00 AM
where is the workbook_open event handler??? Steff_DK[_10_] Excel Programming 2 April 25th 04 02:43 PM
Cell Event Handler David Excel Programming 3 January 19th 04 04:51 PM


All times are GMT +1. The time now is 08:24 PM.

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"