Jump to content
Sign in to follow this  
aisc

Run Excel Macro, then Continue

Recommended Posts

aisc

Looking for a way to have a script kick off a macro (that part I've got done via automating excel menus)... but then, the macro takes a long time to run... when it's done, can it pass a message back to the script, so the script can execute some other actions? Really, there's no easy way to tell, from the GUI that it's done. Is there a programmatic (autoit) way?

Thanks,

aisc

Share this post


Link to post
Share on other sites
Spiff59

There are likely a dozen ways you might go about that.

Setting an environment variable, writing a flat file, making a registry entry, an .ini file...

Maybe you could write a registry entry with the value "working", then call the macro and go into a loop that continues as long as that registry entry exists. Then add a DeleteSettings command at the end of the excel macro to delete the registry entry, which would cause your au3 script to exit the loop and continue execution.

Or, write an empty text file "working.txt", call the macro and have the macro delete the file when finished. Again, you'd loop in your au3 script until FileExists() returned a false.

Edited by Spiff59

Share this post


Link to post
Share on other sites
aisc

There are likely a dozen ways you might go about that.

Setting an environment variable, writing a flat file, making a registry entry...

Maybe you could write a registry entry with the value "working", then call the macro and go into a loop that continues as long as that registry entry exists. Then add a DeleteSettings command at the end of the excel macro to delete the registry entry, which would cause you au3 script to exit the loop and continue execution?

Good suggestions. I guess there's no way to do it with Ole Automation or whatever.

Thanks,

aisc

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×