+ Reply to Thread
Results 1 to 5 of 5

Working with multiple Excel instances

  1. #1
    Registered User
    Join Date
    05-09-2012
    Location
    Mumbai
    MS-Off Ver
    MS Office 2010
    Posts
    15

    Working with multiple Excel instances

    Hi,

    I am using Microsoft Excel for Microsoft 365 MSO (Version 2312 Build 16.0.17126.20132) 64-bit and whatever code I use needs to be also be compatible with MS Excel 2016 32-bit version.

    I have searched various forums to get an effective solution for working with multiple Excel files opened in separate Excel instances however have not found any easy and straight forward way of referencing and doing simple operations such as copy from excel in one instance and paste to another etc.

    A 3rd party application is opening 2 excel instances with 1 excel file opened in one instance and 2 excel files in another excel instance. The 2nd instance has the .xlsm file which is supposed to have a macro that will do various operation such opening additional files, filtering, copying, pasting data etc from one file to another and then saving the files. Any new file that the macro opens, by default opens in the 2nd Excel instance and is easily referenceable using the filename however the 1 excel file which is opened in a separate instance is not referenceable using file name. I have tried the below but am getting an error...

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,545

    Re: Working with multiple Excel instances

    Try it:
    Please Login or Register  to view this content.
    Artik

  3. #3
    Registered User
    Join Date
    05-09-2012
    Location
    Mumbai
    MS-Off Ver
    MS Office 2010
    Posts
    15

    Re: Working with multiple Excel instances

    Quote Originally Posted by Artik View Post
    Try it:
    Please Login or Register  to view this content.
    Artik
    This hung my system, probably because the file is already open.

    To clarify, there are 2 excel instances - Macro runs from an excel file in one instance and 'Pth_new & FileName3' is already open in another instance.

    The macro opens more files (which open in the same instance as the macro file by default) and has to do various operations such as filter/copy/paste/save file across all the opern files, including the file that is open in another instance.

    I am looking for a straight forward way of referencing this one file, which is in a different instance to enable all the routine operations to be performed on it.

  4. #4
    Forum Expert
    Join Date
    08-17-2007
    Location
    Poland
    Posts
    2,545

    Re: Working with multiple Excel instances

    In this case, you should follow the same way as in your other thread. In a collection of Excel instances, find the appropriate file and assign it to a variable.

    Artik

  5. #5
    Registered User
    Join Date
    05-09-2012
    Location
    Mumbai
    MS-Off Ver
    MS Office 2010
    Posts
    15

    Re: Working with multiple Excel instances

    Quote Originally Posted by Artik View Post
    In this case, you should follow the same way as in your other thread. In a collection of Excel instances, find the appropriate file and assign it to a variable.

    Artik
    Atrik, Thanks for nudging me in the right direction. The link you provided was extremely helpful in understanding how to reference workbooks in different excel instances, just as per my requirement. I also wanted to share another link that I came across in Excelforum which has comprehensive codes for all relevant use cases which might be of help to others, but the forum rules restricted me from sharing links, hence sharing a lead here - Search keyword: macro-to-close-every-workbook-in-all-excel-instances (refer to response by LJMetzger - his response also has a downloadable file embedded with the codes which I am sure would be useful to anyone who wants to dig deeper). Thanks again for your help...Cheers!

+ 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. Excel Macro working on most instances but not when the input is huge
    By Diego_ARM in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-21-2022, 06:17 PM
  2. Replies: 3
    Last Post: 06-24-2021, 10:41 AM
  3. [SOLVED] Excel - Simple Index Match - Return all Instances - not working
    By ironfelix717 in forum Excel Formulas & Functions
    Replies: 6
    Last Post: 12-30-2017, 10:59 AM
  4. Multiple Instances Of Same Excel
    By NeedForExcel in forum Excel General
    Replies: 3
    Last Post: 08-18-2015, 02:36 AM
  5. [SOLVED] Complex VLOOKUP, multiple instances vertical, return subsequent instances horizontally
    By Miles_2804 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 08-12-2013, 11:54 AM
  6. Inputting data from multiple instances from multiple users into a main Excel Workbook
    By smooth_beaker in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-04-2013, 12:18 AM
  7. Multiple Instances of Excel
    By maru487 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 11-04-2010, 12:36 PM

Tags for this Thread

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