Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Run Time control events

Hi

I have a form with a frame. In that frame, I add TextBox controls during run time.
Question: how can I trap the change event of these controls which were added at runtime

Thanks in advanc

Christof
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 391
Default Run Time control events

wrap the control in a class which handles the event. add
a new instance of the class for each control and add it
to a collection.

Patrick Molloy
Microsoft Excel MVP

-----Original Message-----
Hi,

I have a form with a frame. In that frame, I add TextBox

controls during run time.
Question: how can I trap the change event of these

controls which were added at runtime?

Thanks in advance

Christof
.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Run Time control events

I've create a class holding two textboxes as

Public WithEvents SystemBox As TextBox
Public WithEvents DescriptionBox As TextBox

However, I get the message 'object does not source automation events'

Where did I go wrong?
Christof
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Run Time control events

Christof,

Both the Excel and the MSForms library contain an object name
TextBox. The Excel TextBox does not source events, while the
MSForms TextBox does. Because the Excel library appears in the
References list before the MSForms library, the compiler is using
the Excel TextBox when you declare a variable As TextBox.

You need to qualify the TextBox with the MSForms library name.
E.g.,

Public WithEvents SystemBox As MSForms.TextBox


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Christof DB" wrote in
message
...
I've create a class holding two textboxes as

Public WithEvents SystemBox As TextBox
Public WithEvents DescriptionBox As TextBox

However, I get the message 'object does not source automation

events'

Where did I go wrong?
Christof



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 67
Default Run Time control events

Hi Christof,

I've create a class holding two textboxes as

Public WithEvents SystemBox As TextBox
Public WithEvents DescriptionBox As TextBox

However, I get the message 'object does not source automation events'

Where did I go wrong?


You need to declare them As MSForms.TextBox, as Excel has its own
TextBox object.

Regards

Stephen Bullen
Microsoft MVP - Excel
www.BMSLtd.co.uk



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Run Time control events

Oops, forgot about that. Thanks for the info and a nice weekend

Christof
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
# Events over time? Jon M Excel Discussion (Misc queries) 2 May 23rd 09 04:37 PM
Graph of events in time jeichner Charts and Charting in Excel 2 February 3rd 09 02:57 PM
Need formula for time between two events k1ngr Excel Worksheet Functions 5 February 27th 08 05:37 AM
Chart for events per unit of time??? Quin Charts and Charting in Excel 2 February 6th 08 04:45 PM
How can I calculate events that happened at the same time? Stuboy28 Excel Discussion (Misc queries) 2 February 28th 07 09:06 PM


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