Jump to content
Macro Express Forums

Multi-Threading


ecoast

Recommended Posts

After a search I couldnt find anything on this. Can a Macro be multi-threaded? Say for data entry, launching a web page, to process a csv file and enter data into fields of web page.

 

This has been very time saving for repetitive tasks of course, but to have multiple instances would be wonderful :)

 

Thanks in advance!

Link to comment
Share on other sites

I'm not sure what you mean by "multi-thread".

 

According to the online Knowledgebase, only one macro can run at a time. However, you can for example get data from one window, then switch to (activate) another window and enter the data, then switch back to the first window, or to still another window, etc..

 

Or, you could have a macro run in a continuous loop like

REPEAT START

IF WINDOW-A IS RUNNING

ACTIVATE WINDOW-A

DO SOME STUFF

END IF

IF WINDOW-B IS RUNNING

ACTIVATE WINDOW-B

DO SOME STUFF

END IF

IF WINDOW-C IS RUNNING

ACTIVATE WINDOW-C

DO SOME STUFF

END IF

DELAY BRIEFLY

REPEAT END

 

I'm not sure why one would want to do that, though. It's not really multi-threaded, just pseudo-multi. And having a long-running macro like that would block any other macros from running. Usually it would make more sense just to activate a macro based on window name, do whatever stuff you need for that window, then end the macro.

Link to comment
Share on other sites

After a search I couldnt find anything on this. Can a Macro be multi-threaded? Say for data entry, launching a web page, to process a csv file and enter data into fields of web page.

 

This has been very time saving for repetitive tasks of course, but to have multiple instances would be wonderful :)

 

Thanks in advance!

 

What you ask is not multi-threading, it's simply multi-tasking, or running multiple instances of the same macro

 

in answer, no, one macro at a time.

 

What I do to save time is call macros that dynamically write and run vbs files, and not wait for it to finish before continuing in the original macro.

Be careful with this, depending on what you're doing, a loop in the macro may launch your vbs as fast as it can, causing 100 instances to start running at once and crash your PC.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...