+ Reply to Thread
Results 1 to 5 of 5

Master Workbook/Form

  1. #1
    glen.e.mettler@lmco.com
    Guest

    Master Workbook/Form

    I have a workbook that contains a user form with 4 command buttons
    (named IMSTOOLS).
    Each button is connected to a different workbook.
    When a command button is selected, I hide IMSTOOLS and open the
    selected workbook.
    All that works just fine.
    When I close the selected workbook, I want to return to IMSTOOLS.

    I get an error message when I insert IMSTOOLS.show into the BeforeClose
    event of the selected workbook.

    How can I get back to and show the original user form - IMSTOOLS?

    Glen


  2. #2
    windsurferLA
    Guest

    Re: Master Workbook/Form

    I'm not familiar with the "BeforeClose" feature...

    but consider adding a auto_close macro to put things in order.

    Sub auto_close()
    ..........
    End Sub

    WindsurferLA

    glen.e.mettler@lmco.com wrote:
    > I have a workbook that contains a user form with 4 command buttons
    > (named IMSTOOLS).
    > Each button is connected to a different workbook.
    > When a command button is selected, I hide IMSTOOLS and open the
    > selected workbook.
    > All that works just fine.
    > When I close the selected workbook, I want to return to IMSTOOLS.
    >
    > I get an error message when I insert IMSTOOLS.show into the BeforeClose
    > event of the selected workbook.
    >
    > How can I get back to and show the original user form - IMSTOOLS?
    >
    > Glen
    >


  3. #3
    windsurferLA
    Guest

    Re: Master Workbook/Form

    I'm not familiar with the "BeforeClose" feature...

    but consider adding a auto_close macro to put things in order.

    Sub auto_close()
    ..........
    End Sub

    WindsurferLA

    glen.e.mettler@lmco.com wrote:
    > I have a workbook that contains a user form with 4 command buttons
    > (named IMSTOOLS).
    > Each button is connected to a different workbook.
    > When a command button is selected, I hide IMSTOOLS and open the
    > selected workbook.
    > All that works just fine.
    > When I close the selected workbook, I want to return to IMSTOOLS.
    >
    > I get an error message when I insert IMSTOOLS.show into the BeforeClose
    > event of the selected workbook.
    >
    > How can I get back to and show the original user form - IMSTOOLS?
    >
    > Glen
    >


  4. #4
    windsurferLA
    Guest

    Re: Master Workbook/Form

    I'm not familiar with the "BeforeClose" feature...

    but consider adding a auto_close macro to put things in order.

    Sub auto_close()
    ..........
    End Sub

    WindsurferLA

    glen.e.mettler@lmco.com wrote:
    > I have a workbook that contains a user form with 4 command buttons
    > (named IMSTOOLS).
    > Each button is connected to a different workbook.
    > When a command button is selected, I hide IMSTOOLS and open the
    > selected workbook.
    > All that works just fine.
    > When I close the selected workbook, I want to return to IMSTOOLS.
    >
    > I get an error message when I insert IMSTOOLS.show into the BeforeClose
    > event of the selected workbook.
    >
    > How can I get back to and show the original user form - IMSTOOLS?
    >
    > Glen
    >


  5. #5
    uf_gator
    Guest

    Re: Master Workbook/Form

    I suspect that the error is because the IMSTOOLS userform is not
    located in the workbook where you are running the BeforeClose event.

    I am pretty sure that when you are running macros in workbook A you can
    only access userforms or modules within workbook A.

    You could use the BeforeClose event to activate the workbook containing
    the userform and then use some Activate event in that workbook to show
    the userform (e.g., whenever the workbook is activated, show the
    userform, whenever it is deactivated, hide the userform).

    Alternatively, you could use a custom tool bar instead of the userform.
    The buttons can be linked to a macro to open the files you need to
    open (look for commandbar in the VB Help).


+ 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