+ Reply to Thread
Results 1 to 7 of 7

Closing Workbook & Excel

  1. #1
    Valued Forum Contributor
    Join Date
    09-04-2007
    Location
    Ontario, Ca
    Posts
    624

    Closing Workbook & Excel

    Need a little help please.

    How do I SAVE and CLOSE Workbook and it's instance of Excel.

    I have other instances of excel open that I do not want closed.

    I thought that I had this before, but I can't find it if I did. I do keep a list of all the requests where I ask for help and it's not in this list.
    Thanks for helping . . .
    Matt @ Launchnet

  2. #2
    Registered User
    Join Date
    07-03-2007
    Location
    Canberra, Australia
    MS-Off Ver
    2010
    Posts
    60

    re: Closing Workbook & Excel

    Hi Launchnet,

    I suppose the simplest way is to add

    ThisWorkbook.Close savechanges:=True or
    ActiveWorkbook.Close savechanges:=True
    Kerno

  3. #3
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    re: Closing Workbook & Excel

    dude click the X below the X in the top right corner

    the top one closes all workbook the next one down will only close that instance of excel
    Last edited by pike; 06-26-2009 at 11:46 PM. Reason: read a little too much into the question
    If the solution helped please donate to RSPCA

    Site worth visiting: Rabbitohs

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    re: Closing Workbook & Excel

    Hello Matt,

    This macro will close a workbook that was created in a separate instance of Excel. However, it does not save the workbook. I'll need to do some research on that.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  5. #5
    Valued Forum Contributor
    Join Date
    09-04-2007
    Location
    Ontario, Ca
    Posts
    624

    re: Closing Workbook & Excel

    Kerno . . . Tried your code. It closes the workbook, but leaves the instance of Excel open. Not good.

    Pike . . . I should have mentioned that this is for at the end of a macro that is run, and when the macro is finished, the Workbook and the Instance of Excel needs to be closed.

    Hi Leith . . . I think I can save the workbook before this macro is run and then call my closing macro. I will try it, but I don't have time tonight. Just got home and I will try it late morning. Many thanks. Good hearing from you.

  6. #6
    Forum Expert pike's Avatar
    Join Date
    12-11-2005
    Location
    Alstonville, Australia
    MS-Off Ver
    2016
    Posts
    5,330

    re: Closing Workbook & Excel

    sorry about that reply I kinda knew it would be more ...

  7. #7
    Valued Forum Contributor
    Join Date
    09-04-2007
    Location
    Ontario, Ca
    Posts
    624

    re: Closing Workbook & Excel

    How do I make this as solved since it has been over 12 days. It doesn't allow me to edit.

+ 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