+ Reply to Thread
Results 1 to 4 of 4

Open workbook if not already open then close same file if was not already open

  1. #1
    Forum Contributor
    Join Date
    07-09-2013
    Location
    Nagpur, India
    MS-Off Ver
    Excel 2010 / 2013
    Posts
    293

    Open workbook if not already open then close same file if was not already open

    I've two workbooks in E:\NewFolder\

    Book1.xlsm

    Book2.xlsm


    I needed code in Book1.xlsm to open the Book2.xlsm file if it is not already open. And then close the Book2.xlsm without save changes.
    But if Book2.xlsm was already open then dont close Book2.xlsm file.

  2. #2
    Valued Forum Contributor than_gold's Avatar
    Join Date
    10-17-2017
    Location
    Coimbatore India
    MS-Off Ver
    Office 365
    Posts
    646

    Re: Open workbook if not already open then close same file if was not already open

    You can check here for even for sheets and files as well.
    https://www.rondebruin.nl/win/s9/win003.htm
    Regards,
    Thangavel D

    Appreciate the help? CLICK *

  3. #3
    Forum Expert
    Join Date
    11-22-2016
    Location
    Cornwall,UK
    MS-Off Ver
    office 365
    Posts
    4,240

    Re: Open workbook if not already open then close same file if was not already open

    Amend book2 name (including .xlsm)

    Please Login or Register  to view this content.
    Last edited by kev_; 12-28-2018 at 05:37 AM.
    Click *Add Reputation to thank those who helped you. Ask if anything is not clear

  4. #4
    Forum Contributor
    Join Date
    07-09-2013
    Location
    Nagpur, India
    MS-Off Ver
    Excel 2010 / 2013
    Posts
    293

    Re: Open workbook if not already open then close same file if was not already open

    Quote Originally Posted by kev_ View Post
    Amend book2 name (including .xlsm)

    Please Login or Register  to view this content.
    Thank you so much. SOLVED.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Excel 2007 crash: Just open the file, do anything to it, save, close, open againg = CRASH
    By Alex Piotto in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 03-27-2018, 07:53 AM
  2. [SOLVED] Check for existing File name, open if exist or open new workbook if not
    By COURTTROOPER in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-09-2017, 12:32 AM
  3. [SOLVED] Macro to open workbook with a suffix (need help to check if file is already open)
    By rossi_69 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-24-2017, 11:03 AM
  4. [SOLVED] VBA Open File/Run Macro/Close &Save/Open Next File
    By JPSIMMON in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 10-21-2015, 12:16 PM
  5. Check if a Word File is Open and If Open Close it with Excel VBA.
    By e4excel in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-10-2012, 11:14 AM
  6. Code to open a workbook, do what i want, close it, and open the next
    By stuartsjg in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 09-30-2010, 05:43 PM
  7. Save an open workbook, then open template workbook and close the saved workbook
    By ondvirg in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-27-2009, 10:20 PM

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