Results 1 to 4 of 4
  1. #1
    Bronze Lounger
    Join Date
    Sep 2007
    Posts
    1,203
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Debugging (2002)

    Anyone know what I am doing wrong here?

    In a Userform:

    Private Sub C_Certegy_Session_AfterUpdate()
    strApp = Me.C_Certegy_Session
    End Sub

    Private Sub UserForm_Initialize()
    With Me.C_Certegy_Session
    .AddItem "pudsey.ws"
    .AddItem "Session A"
    .AddItem "Session B"
    .ListIndex = 0
    End With
    End Sub


    In a standard module:

    Public strApp As String


    AppActivate strApp



    When running the sub routine I get:

    Run time error 5 - Invalid procedure or call argument

    Debugging shows: strap="" > but strap should be C_Certegy_Session

    Help please.

  2. #2
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Debugging (2002)

    When in the sequence is AppActivate strApp called? Has the afterupdate event been visited before that?
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  3. #3
    Bronze Lounger
    Join Date
    Sep 2007
    Posts
    1,203
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Debugging (2002)

    Jan,

    > When in the sequence is AppActivate strApp called? - In the main sub routine

    > Has the afterupdate event been visited before that? - Yes, or at least I THINK so. This is linked to a combo box on the userform that is in the workbook open event.

    I moved it to the on-click event of the userform and it works.

    Many Thanks

  4. #4
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Debugging (2002)

    Next time when in doubt if a line of code is vitited, put a breakpoint on the line (select line and hit F9). Then run the code.
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

Posting Permissions

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