PC Review


Reply
Thread Tools Rate Thread

Combo Box Event code self triggering??

 
 
Sam
Guest
Posts: n/a
 
      13th Aug 2008
I have a few workbooks that have combo box controls on them which trigger
some VBA when a change is made by the user. Each workbook on it's own works
fine. When I open a 2nd workbook, for some reason the event code in the
Private Sub of the already opened workbook gets triggered. Why would this
happen? Why doe's opening a 2nd workbook trigger changes in the original?

On a related note, when I open a singel workbook, without the user making
any changes the event code executes. I'm guess that during the initial
calculation the linked cell value is getting updated which changes the
control which activates the code.

When I debug I can see that thisworkbook.name <> activeworkbook.name.

Here's an example of the Control code:
Private Sub Selector_Market_Change()
If Not ImBusy Then
ImBusy = True
Application.ScreenUpdating = False
theCell = Selection.Address
Sheets("Params").Range("theBenchmark") =
Sheets("Params").Range("theBenchmarkCalc") 'I get an error here since the
range doesn't exist in the new book.
Call Get_Data1
Range(theCell).Select
ImBusy = False
End If
End Sub

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
onMouseOver event is triggering the parent element's code Nathan Sokalski Windows XP Internet Explorer 1 19th Jun 2006 07:50 PM
Userform combo box triggering macros michaelberrier Microsoft Excel Misc 6 10th Jun 2006 01:25 PM
Doing a javascript form.submit and triggering server side event code for button John Boy Microsoft ASP .NET 4 9th Nov 2005 11:25 AM
Triggering code when a new all-day event is entered James Martin Microsoft Outlook VBA Programming 2 8th Nov 2004 06:09 AM
Combo box NotInList event - why does this code not work Andrew Smith Microsoft Access Forms 2 26th Sep 2003 10:05 PM


Features
 

Advertising
 

Newsgroups
 


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