View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
pinkfloydfan pinkfloydfan is offline
external usenet poster
 
Posts: 68
Default WithEvents problem

A strange one this. I have been using John Walkenbach's excellent tip
on how to trap events in a class so that multiple objects that I want
to respond in the same way to a specific Event can reference a single
line of code.

Now a problem has arisen when trying to trap events for all Textboxes
on a UserForm: it appears that not all the events are available to the
WithEvents handler in the class...specifically I have no access to the
BeforeUpdate, AfterUpdate, Enter, Exit events (and probably others).

Although there is a Change event this runs after every change, not
every update so is a bit cumbersome.

Does anybody know why all the usual Events are not available? Or how
to circumvent this?

I did try trapping all Controls (the AfterUpdate event is available
for that in a class) rather than all Textboxes and then within the
AfterUpdate event determine if the TypeOf control was MSForms.Textbox
but I got an error saying that that Event was not supported.

Thanks a lot
Lloyd