473,326 Members | 2,113 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

How to run the Excel Macros in parallel

Does anyone know the code for running the Excel Macro for two different spreadsheets in parallel. Here is the code that works for them sequentially.
Expand|Select|Wrap|Line Numbers
  1. Workbooks.Open Filename:="C:\Documents and Settings\Administrator.SLB_EUROPE\Desktop\norm ops 150607.xls"
  2.  
  3. ' Select Asset & Portfolio Parameter sheet
  4. Sheets("Asset & Portfolio Parameter").Select
  5.  
  6. ' Change the number of iterations
  7. Range("D7").Select
  8. ActiveCell.FormulaR1C1 = "50"
  9.  
  10. ' Start to run the macro
  11. Range("D8").Select
  12. Application.Run "'norm ops 150607.xls'!Macro2"
  13.  
  14. ' Save and close the spreadsheet
  15. ActiveWorkbook.Save
  16. ActiveWindow.Close
  17.  
  18.  
  19.  
  20.  
  21. Workbooks.Open Filename:="C:\Documents and Settings\Administrator.SLB_EUROPE\Desktop\sachsend isruption6mths.xls"
  22.  
  23. ' Select Asset & Portfolio Parameter sheet
  24. Sheets("Asset & Portfolio Parameter").Select
  25.  
  26. ' Change the number of iterations
  27. Range("D7").Select
  28. ActiveCell.FormulaR1C1 = "50"
  29.  
  30. ' Start to run the macro
  31. Range("D8").Select
  32. Application.Run "'sachsendisruption6mths.xls'!Macro2"
  33.  
  34. ' Save and close the spreadsheet
  35. ActiveWorkbook.Save
  36. ActiveWindow.Close
  37.  
  38.  
For example, I would like to write the code which allows these macros to run in parallel so that it would take only one fourth of the time to run macros that it would take if running sequentially for four different spreadsheets.

Thanks.
Jun 26 '07 #1
2 2999
Dököll
2,364 Expert 2GB
Greetings, modularmix!

I fetched Google on this one only becasue I was not sure what exactly you are trying to do. Please give link a whirl see what you have. Merely plugged in your title and fired away:

http://www.google.com/search?hl=en&r...+Excel+Macros+

Write if more help is needed...
Jun 27 '07 #2
Killer42
8,435 Expert 8TB
Let us know what you find out, too. I don't think it's possible to multi-stream your macros, but it will probably turn out that I'm wrong.

Perhaps if one were fired by OnTime() or something...
Jun 27 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Prakash | last post by:
Hi, We face problems uploading excel (with macros) documents using HTML File Upload. The file contents are corrupted while viewing the same. However, we are able to upload excel (w/o. macros)...
1
by: Scott Wallace | last post by:
Anyone know how to disable macros when access an Excel file through automation? I have an Excel file that fires macros when it is opened. I need to automate reading values from the file through a...
3
by: OhMyGaw | last post by:
Hello Excel/automation Gurus, I am working on an application where I have to keep a centralized database of all macros distributed to user and save the changes back on a nightly basis back to...
1
by: Dartish | last post by:
Hi all, Thanks in advance for the help I have a DLL that which has several functions that I can call in Excel. I am thinking of how to call these functions in a .net project (authored in C#)....
3
by: jeremy.bird | last post by:
I am looking for a possible solution or bump in the right direction when working with excel on the web. Currently I am using and developing in visual studio 2005. Here is the situation I have a lot...
0
by: husky81 | last post by:
Greetings: I have Excel 2000 on my work pc. I've written some macros using the sendkeys command to control a mainframe application. A co-worker has Excel 2003. She seems to have a lot of...
3
by: dan_roman | last post by:
Hi, I developed a script with a nice interface in Tkinter that allows me to edit some formulas and to generate an Excel worksheet with VBA macros within it. The script runs perfectlly in Office...
4
by: Suzette | last post by:
I have an excel file that automatically updates when opened, pulling information from an Access database into into various pivot tables. I created a macro in Access to perform various necessary...
8
by: =?Utf-8?B?SmVycnkgQw==?= | last post by:
I have a web site that automates excel. This site runs in server 2003. iis 6.0 office 2003 installed I moved this app to server 2008 iis 7.0 office 2003 installed Now when I try to automate...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.