code that waits for some other code to run

oliver_penney

Board Regular
Joined
Dec 18, 2002
Messages
182
allo

i have some code that calls a button on an xla toolbar i have

the button, after ~10 seconds comes up with a load of data from an external system

so i thought i would do some code that said:-

press the button
wait until now + 30 seconds
save

but NO, that nevers works, it never has any data there, so i thought i'd try:-

press button
do
loop until the cursor<>hourglass
save

but NO, that never works either, it gets stuck in an infinite loop

not sure why they don't work. any ideas anyone?
 

Excel Facts

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.
sure, i've changed it a bit since to work around it, but it was something like:-

Sub ButtonSave
dim Thispath as string, ThisWB as string

thispath=activeworkbook.path
thiswb=activeworkbook.name

'hit the button on the toolbar
commandbars("Trading System API Tools 4.2").controls("go").execute
'then wait
Application.Wait (Now + TimeValue("0:02:00"))
'then save down datestamped
activeworkbook.saveas "BB Positions " & format(now(),"ddmmyy") & ".xls"
'then save back as the original
activeworkbook.saveas thispath & "\" & thisname

end sub
 
Upvote 0
Have you tried running it with just the commandbars("Trading System API Tools 4.2").controls("go").execute on it's own? I'm under the impression that it will run that code, then continue onto the next line. So if there is no data, it should lie in the fault of the routine on the "go" control.
 
Upvote 0

Forum statistics

Threads
1,203,238
Messages
6,054,312
Members
444,715
Latest member
GlitchHawk

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top