+ Reply to Thread
Results 1 to 9 of 9

Opening and closing one workbook after another

  1. #1
    Registered User
    Join Date
    09-06-2010
    Location
    Bristol
    MS-Off Ver
    Excel 2003
    Posts
    96

    Opening and closing one workbook after another

    Hi guys

    Please find attached the workbooks. It should work each time you press Enter and Logoff button. When you press Enter button then startup form of another workbook should get opened and when we press close then second workbook should be closed and the startup form of first workbook should get displayed. The whole procedure in the attached workbooks works fine once but not if you do it again and again.

    Thanks
    Attached Files Attached Files
    Last edited by Nancy123; 10-21-2010 at 08:37 AM.

  2. #2
    Registered User
    Join Date
    09-06-2010
    Location
    Bristol
    MS-Off Ver
    Excel 2003
    Posts
    96

    Re: Opening and closing one workbook after another

    Does anyone have the answer of my question?

    Please help me solve it.

    Thanks

  3. #3
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,985

    Re: Opening and closing one workbook after another

    Change the form in SAM2 to:
    Please Login or Register  to view this content.
    and the form in SAM1 to:
    Please Login or Register  to view this content.
    Everyone who confuses correlation and causation ends up dead.

  4. #4
    Registered User
    Join Date
    09-06-2010
    Location
    Bristol
    MS-Off Ver
    Excel 2003
    Posts
    96

    Re: Opening and closing one workbook after another

    Hi Romper

    Its not working properly. When I click on Logoff button of sam2 workbook then startup form of sam1 workbook should get opened.But it is not working as desired. Can you please check it again. First open sam1 workbook and press Enter button then in the new userform press logoff , Now the sam1 workbook should be opened but its not.

    Thanks

  5. #5
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,985

    Re: Opening and closing one workbook after another

    Sorry - I should have tested that before posting. The closing of the second workbook by the second form is the issue.
    Can you explain the process a bit more and tell us whether the second workbook is ever opened by itself, rather than from the first workbook?

  6. #6
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,985

    Re: Opening and closing one workbook after another

    Never mind, this should work.
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    09-06-2010
    Location
    Bristol
    MS-Off Ver
    Excel 2003
    Posts
    96

    Re: Opening and closing one workbook after another

    It seems working fine. Is it also possible not to close sam1 workbook when sam2 workbook is opened that means displaying sam2 workbook userform upon sam1 workbook userform.

    Thanks

  8. #8
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    21,985

    Re: Opening and closing one workbook after another

    Remove the Me.Hide and Me.Show lines from the first form.

  9. #9
    Registered User
    Join Date
    09-06-2010
    Location
    Bristol
    MS-Off Ver
    Excel 2003
    Posts
    96

    Re: Opening and closing one workbook after another

    Brilliant Romper. Thanks a lot for your 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