+ Reply to Thread
Results 1 to 3 of 3

Edit code to close all workbooks except active workbook and other specific workbook

  1. #1
    Registered User
    Join Date
    04-05-2012
    Location
    Malaysia
    MS-Off Ver
    Excel 2007
    Posts
    88

    Edit code to close all workbooks except active workbook and other specific workbook

    Hello guys, can anyone help me edit this code, currently it closes all workbooks except the active one, I want it to close all except active workbook and another specific workbook.

    I tried editing the code to close active workbook and another specific workbook using array, but it doesnt work.

    Please help out.

    Below is current code

    Please Login or Register  to view this content.
    Thanks all.

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

    Re: Edit code to close all workbooks except active workbook and other specific workbook

    maybe
    Please Login or Register  to view this content.
    Josie

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

  3. #3
    Registered User
    Join Date
    04-05-2012
    Location
    Malaysia
    MS-Off Ver
    Excel 2007
    Posts
    88

    Re: Edit code to close all workbooks except active workbook and other specific workbook

    Hi JP,

    Thanks for replying,

    I tried your code, the original code kept the activeworkbook open but closed "OTHERWORKBOOK.XLSM". Apparently the code only takes into account the first workbook only in the line,

    Please Login or Register  to view this content.
    So I edited the code like shown below, and now it works.

    Please Login or Register  to view this content.
    Thank you very much JP for pointing me in the right direction.

+ 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