+ Reply to Thread
Results 1 to 3 of 3

Closing / Opening Workbooks

  1. #1
    Registered User
    Join Date
    01-28-2005
    Posts
    70

    Closing / Opening Workbooks

    Hi folks,

    Happy New Year to all.

    I have a workbook containing a macro that asks the user to do a SaveAs of that workbook by popping a SaveAs dialog box up for the user to use. After that's done, is there a way to close the active workbook and go open the saved one, through the (same) macro? Or will the moment the workbook closes cause the macro to also quit? Do I have to open the saved-as version before closing the current one?

    Is there another way of achieving this (if the above isn't possible)?

  2. #2
    Forum Expert Simon Lloyd's Avatar
    Join Date
    03-02-2004
    Location
    locked in the cage
    MS-Off Ver
    All the ones my homepage shows
    Posts
    3,161
    Hi try this, as long as after your save as you do not close the newly saved workbook (this code also expects that a workbook is already open other than your new one!)
    Please Login or Register  to view this content.
    regards,
    Simon
    Last edited by Simon Lloyd; 01-02-2007 at 03:20 AM.

  3. #3
    Forum Contributor
    Join Date
    11-29-2003
    Posts
    1,203
    Yes, you need to close the workbook before opening the other one. Or, as you guessed, the macro will quit before it gets to the Open command.

    If you want a process to "continue" with the opened workbook, you could use Application.OnTime to call a subroutine.

+ 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