Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default How to Pause an Excel VBA script without freezing excel

Hello,

I wrote an application that uses a VBA object called iMacros. iMacros
is a browser automation tool. My program uses iMacros to fill forms.
The iMacros object launches a browser and runs its own script in the
browser. While the script is running the VBA program is paused. I
believe this is causing Excel to display 'Not Responding' messages.

I believe I have two possible solutions to this problem:

1) If I pause the VBA program using VBA native methods, will that
eliminate the freezing? the iMacros plugin has a return object that
will return 'True' when the script is complete. Here is pseudocode
explaining the idea:

i. prepare VBA script to pause
ii. play iMacros script
iii. pause VBA script until iMacros object returns true
iv. when iMacros object returns true continue.

I'm not sure if this is possible; the iMacros object might already
pause excel. I have no experience with threading; and I have no idea
what threading options are available in excel.

2) The second solution is stop the program, between each run of the
script, let excel respond to windows so windows doesn't give a 'Not
Responding" message, and then continue.

Any thoughts?

Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,522
Default How to Pause an Excel VBA script without freezing excel

On Nov 9, 5:34*pm, duadinam wrote:
Hello,

I wrote an application that uses a VBA object called iMacros. *iMacros
is a browser automation tool. *My program uses iMacros to fill forms.
The iMacros object launches a browser and runs its own script in the
browser. *While the script is running the VBA program is paused. *I
believe this is causing Excel to display 'Not Responding' messages.

I believe I have two possible solutions to this problem:

1) *If I pause the VBA program using VBA native methods, will that
eliminate the freezing? *the iMacros plugin has a return object that
will return 'True' when the script is complete. *Here is pseudocode
explaining the idea:

i. prepare VBA script to pause
ii. play iMacros script
iii. pause VBA script until iMacros object returns true
iv. when iMacros object returns true continue.

I'm not sure if this is possible; the iMacros object might already
pause excel. *I have no experience with threading; and I have no idea
what threading options are available in excel.

2) The second solution is stop the program, between each run of the
script, let excel respond to windows so windows doesn't give a 'Not
Responding" message, and then continue.

Any thoughts?

Thanks


Maybe you could have a 2nd macro and in the first then use IF

if true then
run macro 2
else
continue or run macro 3
end if

also explore ENABLEEVENTS



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Stop / Pause a Macro using Pause button scott56hannah Excel Programming 0 June 27th 08 12:48 PM
Pause Excel Macro Ollie Excel Discussion (Misc queries) 3 June 14th 06 06:59 AM
Excel 2000/XP script to Excel97 script hat Excel Programming 3 March 2nd 04 03:56 PM


All times are GMT +1. The time now is 05:15 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"