+ Reply to Thread
Results 1 to 4 of 4

application.goto to go to a form

Hybrid View

  1. #1
    Registered User
    Join Date
    09-27-2012
    Location
    Warrington, England
    MS-Off Ver
    Excel 2007
    Posts
    27

    application.goto to go to a form

    Hi, wonder if anyone can help with this question. I know that I can use Application.Goto (ProcedureName) to go to a specific VB procedure in the Editor in the same workbook but is it possible to go to a procedure which is in a different workbook? I actually want to go to a specific form in another workbook and show it in the VBE so the user can look at any code that is contained within the form such as UserForm1_Initialize. To illustrate, Book 1 contains the procedure that opens the VBE but Book 2 has the form that I want to the user to view in the VBE.
    Thanks in advance.

  2. #2
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: application.goto to go to a form

    you can't do that with goto as far as I know0you have to manipulate the vbe
       With Application.VBE
          Set .Activevbproject = Workbooks("some_file.xlsm").VBProject
          Set .ActiveCodePane = .Activevbproject.VBComponents("Userform_name").CodeModule.CodePane
       End With
    Josie

    if at first you don't succeed try doing it the way your wife told you to

  3. #3
    Registered User
    Join Date
    09-27-2012
    Location
    Warrington, England
    MS-Off Ver
    Excel 2007
    Posts
    27

    Thumbs up Re: application.goto to go to a form

    Thank you! Perfect, does exactly what I needed. Always amazed by the clever knowledgeable folk that are out there and willing to help!

  4. #4
    Forum Guru JosephP's Avatar
    Join Date
    03-27-2012
    Location
    Ut
    MS-Off Ver
    2003/10
    Posts
    7,328

    Re: application.goto to go to a form

    my pleasure

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.


    New quick method:
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

    Or you can use this way:

    How to mark a thread Solved
    Go to the first post
    Click edit
    Click Go Advanced
    Just below the word Title you will see a dropdown with the word No prefix.
    Change to Solved
    Click Save

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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