+ Reply to Thread
Results 1 to 6 of 6

Opening / Running VBA form via macro

  1. #1
    Registered User
    Join Date
    03-19-2010
    Location
    Felixstowe
    MS-Off Ver
    Excel 2003
    Posts
    34

    Opening / Running VBA form via macro

    Hi,

    I was hoping someone could help me with a, hopefully easy, problem.

    I am using a spreadsheet which has an additional right click menu item in, which opens up a VBA form. What I would like to do is create a macro which will open and run the form. The firm is called BUILDER in a VBA project called bvxlrw.

    If this isn't enough information please let me know and I will elaborate.

    Many Thanks

    James

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

    Re: Opening / Running VBA form via macro

    is the form in a different project from the code that you want to show it? if it is, you can't do it unless the project that contains the form has a routine to show the form-in which case you call that-or has made the form publicly accessible in which case you need to set a reference to that project and then you can run the form
    Josie

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

  3. #3
    Registered User
    Join Date
    03-19-2010
    Location
    Felixstowe
    MS-Off Ver
    Excel 2003
    Posts
    34

    Re: Opening / Running VBA form via macro

    Hi JP,

    Thanks for that, it is in a different project. Couple of spin off questions is that is OK:
    1 - Is there a quick / obvious way to check if a routine has been created, would this be underneath a specific folder? e.g. class modules / modules
    2 - How would I check if the form has been made publicly accessible? And if it hasn't could you point me in the right direction for setting a reference please?

    Thanks

    james

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

    Re: Opening / Running VBA form via macro

    1. set a reference to the other project using tools-references in the vb editor. you can then use the object browser (f2) to view all the exposed routines in that project
    2. I reckon the chance of the form being publicly exposed is less than 1% but once you have set a reference (see 1) you can then try declaring a variable as that form
    Please Login or Register  to view this content.
    and see if that works

  5. #5
    Registered User
    Join Date
    03-19-2010
    Location
    Felixstowe
    MS-Off Ver
    Excel 2003
    Posts
    34

    Re: Opening / Running VBA form via macro

    Hi JP,

    Up to a point that works fine, lol. I can not refer to BVXLRW, however when I add the . in the list does not bring up the form. Could you advise how to expand this menu?

    Thanks
    James

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

    Re: Opening / Running VBA form via macro

    if you don't see the form listed then it's not exposed-I said it was very unlikely! ;-)
    if there isn't a function to load the form then your only other possibility will be to try and execute the button on the right-click menu but that will depend on whether that is added when the add-in loads or on the fly when you right click

+ 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