+ Reply to Thread
Results 1 to 6 of 6

Running two vba macros in parallel

  1. #1
    Registered User
    Join Date
    09-08-2008
    Location
    Australia
    Posts
    3

    Running two vba macros in parallel

    Hi all,

    I have two vbscript scripts spawning the same vba macro from different logons on a windows server 2003. Both Excel macros are similar, both reside in different directories, but require two different datasets (tables in Oracle DB). Both scripts are scheduled from the task manager. When scheduled in series, they run ok, both run about 2 hours (so 4 hours in total). When they are scheduled more or less in parallel (the second starts about 10 minutes later). The first finishes but the second gets stuck, and never resumes. Can vba macros be run in this fashion? It seems not.

    Thanks for any tips.

    Milos

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    I'm not clear what you are doing. Are you trying to run two different macros at the same time? If so I don't think you can. Are they in different workbooks?
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    09-08-2008
    Location
    Australia
    Posts
    3
    Hi Roy,

    The macros have the same code but are in two different workbooks and the workbooks are in two different directories. I've tried to seperate them as much as possible.

    Milos

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    I really don't think you can run two macros from the different workbooks, or even from the same workbook, at the same time. You would need the code in one workbook & to be amalgamated into one macro.

    Four hours to run any macro seems excessive to me.

  5. #5
    Registered User
    Join Date
    09-08-2008
    Location
    Australia
    Posts
    3
    RoyUK,

    I think I am not explaining myself properly. I have one macro copied into two locations on the hard disk. I have two accounts and I want to run this macro from these two accounts. It is the same macro, but I want to run it from two different accounts from two different locations. The only difference is that they access different data in the database. These macros generate about 10000 charts daily and work fine when not run in parallel. They compare weather data for 800 station for seven days ahead and that is why they run so long. There is nothing strange about that. I just want to parallelise the processes, because I want add more macros. I could run them in virtual machines but I don't want to go down that road just yet.
    Thanks for your help so far.
    Milos

    Milos

  6. #6
    Forum Contributor
    Join Date
    07-01-2008
    Location
    Cincinnati, OH
    Posts
    150
    Have you tried running them is separate instances of Excel? There is only one thread allocated for VBA in each instance.

+ 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 macros on protected sheets
    By baz0912 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-25-2008, 05:11 AM
  2. running macros in shared workbooks
    By Ianaitch in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-07-2007, 06:12 AM
  3. running macros
    By Mut in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-14-2007, 04:51 AM
  4. Running macros in Excel97 that was created in Excel XP
    By Dust For Eyes in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 03-12-2007, 12:37 AM
  5. Running Scheduled Tasks Macros While Cpu Is "logged Off" From Network
    By Chuckles123 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-12-2006, 03:31 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