+ Reply to Thread
Results 1 to 11 of 11

How can I run 2 instances of Excel 2002 while running a macro in both at the same time?

  1. #1
    Registered User
    Join Date
    09-02-2013
    Location
    US
    MS-Off Ver
    Excel 2002
    Posts
    25

    How can I run 2 instances of Excel 2002 while running a macro in both at the same time?

    I am able to open excel in 2 separate instances, but whenever I run a macro in one spreadsheet, first of all it lists the macro available on the 2nd sheet as well (which is probably a part of my problem since it shows that the macro tool is only run once for both instances?), but most importantly once I start to execute the macro on the first spreadsheet (and until that macro is done), I can no longer work on the 2nd spreadsheet, much less start the macro on the 2nd spreadsheet...

    Is there a way to run macros separately and independently on both spreadsheets at once? (short of logging in to multiple windows users at once I guess).

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: How can I run 2 instances of Excel 2002 while running a macro in both at the same time

    Hi, Dimple777,

    if I open two instances of Excel I can´t see any macro from any workbook in the other instance. So I guess you are in the same instance of the application just different windows. I´d go with running the macro in one worksheet and start it for the next thereafter - maybe you could try DoEvents but I doubt that to be very effective for the scenario I have in mind when I read your post.

    You should clarify about what you call instances as well as sheets.

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Registered User
    Join Date
    09-02-2013
    Location
    US
    MS-Off Ver
    Excel 2002
    Posts
    25

    Re: How can I run 2 instances of Excel 2002 while running a macro in both at the same time

    I can alt tab between both "instances" as is, they show up as two separate windows at the bottom. However, yes the fact that the macro tool shows macro from the other sheet does make me think the macro tool is only run once.
    I am curious, are you using Excel 2002 or a later version?
    I am not familiar with "DOEvents", I am quite the beginner with macros and excel, but once I start the macro on one file, until it is done with all its processing, I cannot access the window of the other one, much less start a macro on it.

  4. #4
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: How can I run 2 instances of Excel 2002 while running a macro in both at the same time

    Hi, Dimple777,

    startuing with Excel2000 the windows could get grouped or laid single into the tray. And yes, with the PC I use I work with Excel2013.

    DoEvents is an Interaction tool which will halt the execution of Excel and hand over to the Operating System for any alterations to be made.

    And with Excel there can only be one macro active, no matter whether it´s an event or a macro. When this macro is finished the next macro is started. So you might use a counter an start the same macro for the next sheet at the end:
    Please Login or Register  to view this content.
    with EF956608 being the name of the macro. This macro will run donw once and the be started once again. Make sure that the correct sheet is referenced in the macro.

    Ciao,
    Holger

  5. #5
    Registered User
    Join Date
    09-02-2013
    Location
    US
    MS-Off Ver
    Excel 2002
    Posts
    25

    Re: How can I run 2 instances of Excel 2002 while running a macro in both at the same time

    But that's the thing, I don't want them to be run sequentially. I wanted to open up my worksheet A, run its macro (which takes a long time since it does like 9000 web queries) and in the meantime, still be able to access worksheet B, edit it, or run its own macro if I needed to (while file/worksheet A is still processing its own macro and doing its thing). That's what I am trying to accomplish.

  6. #6
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: How can I run 2 instances of Excel 2002 while running a macro in both at the same time

    Hi, Dimple777,

    I don't want them to be run sequentially
    I´m afraid there is no other choice than proceeding on a one after one base in one instance. Maybe you should try to split the number of queries up into smaller numbers (which will also show this behaviour of only running one macro at a time) to earlier have access to Excel.

    Ciao,
    Holger

  7. #7
    Registered User
    Join Date
    09-02-2013
    Location
    US
    MS-Off Ver
    Excel 2002
    Posts
    25

    Re: How can I run 2 instances of Excel 2002 while running a macro in both at the same time

    Awww... I was really expecting that there would be a way to do it. How come excel doesn't allow 2 true instances of itself to run at the same time? The queries are not even CPU intensive... I have run multiple instances of plenty of other programs in the past, I'm quite disappointed that excel wouldn't allow that.
    Still, thank you for your help.

  8. #8
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: How can I run 2 instances of Excel 2002 while running a macro in both at the same time

    Hi, Dimple777,

    you have been quiet about the creation of all these queries. If these were created by VBA you might break them down, if these are queries within Excel I´m afraid I simply don´t know a way to handle it the way you want it to be handled.

    Ciao,
    Holger

  9. #9
    Registered User
    Join Date
    09-02-2013
    Location
    US
    MS-Off Ver
    Excel 2002
    Posts
    25

    Re: How can I run 2 instances of Excel 2002 while running a macro in both at the same time

    My worksheet has a list of roughly 9000 URLs searches (i'm using this to study server populations on an MMORPG).
    Here is an example URL:
    http://na.finalfantasyxiv.com/lodest...tribe_3&order=

    My macro sends this URL to a text only extractor (boilerpipe and google) which returns in my excel sheet the number of results for that query (177 at the time of writing for the example URL above). Then it moves on to the next cell until it's done. While boilerpipe is fast, it has a low limit cap, so when it caps, the query gets send to google, but google is a good 3-4 times slower to return the result. This results in my macro lasting like 6-7h to run once at the present time. If I could run two instances of excel at once, I could either split the URLs into several worksheets that could be run all at the same time (thus reducing the time it takes for me to gather all the results) or I could at the very least still use excel for other tasks during that period of time. As it is, if I want to use excel during that time, I have to interrupt my macro, do what I need to do on excel, then resume it (which further increases the lenght of time it takes for it to complete).

  10. #10
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643
    Are you sure Excel is the right tool for this?
    If posting code please use code tags, see here.

  11. #11
    Registered User
    Join Date
    09-02-2013
    Location
    US
    MS-Off Ver
    Excel 2002
    Posts
    25

    Re: How can I run 2 instances of Excel 2002 while running a macro in both at the same time

    Well, I don't know how to do it any other way... Although it's a bit slow, it does the job.

+ 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. Running separate excel instances Office 2013
    By MikeFranz123 in forum Excel General
    Replies: 1
    Last Post: 08-17-2013, 01:53 PM
  2. [SOLVED] run time error 13 type mismatch when running VB macro in Excel 97
    By bkwins in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-06-2013, 04:41 AM
  3. Determine Number of Instances of Excel Running.
    By bdb1974 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-01-2011, 02:29 PM
  4. Running Multiple Excel VBA instances
    By mynci in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-28-2009, 11:28 AM
  5. [SOLVED] Access 2002 VB Module controlling Excel 2002 spreadsheet -Run-time
    By Mblackmore in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-12-2005, 03:06 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