Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Stoppoing ComboBox Change Event from firing when Multipage changes

I have a Userform with two-page Multipage control. Multipage1 contains
a combobox (ComboBox1) tied to a excel file (File1)opened in the
background during form initialization. ComboBox1 lists the sheets in
File1. Multipage1 also contains a listbox (ListBox1) that displays
data on the sheet selected in ComboBox1. Updating the contents of
ListBox1 is controled via the "Change" event for ComboBox1. Works like
a champ.

Multipage2 also contains a listbox (Listbox2) that displays data from a
separate excel file (File2). To populate ListBox2, the user identifies
which excel file to open via a command button using
Application.GetOpenFilename. The identifed File2 is then opened in the
background. So both File1 and File2 are open in the background.

And now the problem. If the user has selected a sheet in ComboBox1 and
then proceeds to Multipage2 to select File2 such that ListBox2 is
populated, the "Change" event code tied to ComboBox1 also fires because
changing pages is a Change event for ComboBox1. The Change event code
crashes as the code is attempting to execute on File2 and not File1. I
am fairly certain that this is the issue as no error occurs if no sheet
has been selected in ComboBox1 before the user proceeds to Multipage2.

How can I trap this? I tried changing the event tied to Combobox1 from
"Change" to "AfterUpdate" but ListBox1 would not update until I took
the focus off ComboBox1.

Thanks in Advance.

GH

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
Worksheet change event not firing Wexler Excel Programming 11 October 25th 04 09:45 PM
Change Cell from Validated List Not Firing Worksheet Change Event [email protected] Excel Programming 3 October 4th 04 03:00 AM
Deactivating Multipage Change Event [email protected] Excel Programming 0 September 9th 04 03:13 AM
Deactivating Multipage Change Event [email protected] Excel Programming 2 September 9th 04 02:49 AM
OnTime event not firing in Workbook_Open event procedure GingerTommy Excel Programming 0 September 24th 03 03:18 PM


All times are GMT +1. The time now is 11:42 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"