Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Calling an embedded items event procedure from within a normal module

Trying to call the event procedure "Private Sub TxtString_GotFocus()"
from with a normal module in the same workbook.

The event procedure is for a textbox that is embedded in Sheet4 so the
event procedure is within the class module connected to Sheet4

Must be quite easy, but keeps throwing an error for me

Help greatly appreciated
Jason

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Calling an embedded items event procedure from within a normal module

The following code works for me just fine in Excel 2003.

Private Sub TextBox1_GotFocus()
MsgBox "GotFocus"
End Sub

What specific error are you seeing?


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




"jase" wrote in message
oups.com...
Trying to call the event procedure "Private Sub
TxtString_GotFocus()"
from with a normal module in the same workbook.

The event procedure is for a textbox that is embedded in Sheet4
so the
event procedure is within the class module connected to Sheet4

Must be quite easy, but keeps throwing an error for me

Help greatly appreciated
Jason



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Calling an embedded items event procedure from within a normal module

You need to declare it as public and then use

Sheet4!TxtString_GotFocus

to call it from the normal module.

--
Regards,
Tom Ogilvy


"jase" wrote in message
oups.com...
Trying to call the event procedure "Private Sub TxtString_GotFocus()"
from with a normal module in the same workbook.

The event procedure is for a textbox that is embedded in Sheet4 so the
event procedure is within the class module connected to Sheet4

Must be quite easy, but keeps throwing an error for me

Help greatly appreciated
Jason



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Calling an embedded items event procedure from within a normal module

just to be pedantic Tom (as I'm sure it was just a little typo) but the
code that worked was:

Sheet4.TxtString_GotFocus

Thanks again
Jason

Tom Ogilvy wrote:
You need to declare it as public and then use

Sheet4!TxtString_GotFocus

to call it from the normal module.

--
Regards,
Tom Ogilvy


"jase" wrote in message
oups.com...
Trying to call the event procedure "Private Sub TxtString_GotFocus()"
from with a normal module in the same workbook.

The event procedure is for a textbox that is embedded in Sheet4 so the
event procedure is within the class module connected to Sheet4

Must be quite easy, but keeps throwing an error for me

Help greatly appreciated
Jason


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
Calling procedure from another WKB with parameters Ajit Excel Programming 5 November 18th 04 10:43 PM
Calling a procedure in a procedure Norman Jones Excel Programming 8 August 20th 04 07:53 PM
Calling a procedure in a procedure N10 Excel Programming 2 August 18th 04 12:49 AM
Calling a procedure in a procedure Don Guillett[_4_] Excel Programming 1 August 17th 04 11:31 PM
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 02:53 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"