+ Reply to Thread
Results 1 to 4 of 4

Calling an embedded items event procedure from within a normal module

  1. #1
    jase
    Guest

    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. #2
    Chip Pearson
    Guest

    Re: 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" <[email protected]> wrote in message
    news:[email protected]...
    > 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. #3
    Tom Ogilvy
    Guest

    Re: 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" <[email protected]> wrote in message
    news:[email protected]...
    > 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. #4
    jase
    Guest

    Re: 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" <[email protected]> wrote in message
    > news:[email protected]...
    > > 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1