Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 285
  • Last Modified:

Script Control

I get the run-time error -2147467259 (80004005).  Cannot call this method when the script is executing.

I have an app that uses the ScriptControl, when I close the the method ScriptControl.Reset is called which causes the above error.

How do I check that the script is executing or stop from doing so?

many thanks.
0
TJ_Eng
Asked:
TJ_Eng
  • 2
1 Solution
 
NBrownohCommented:
ScriptControl1.State = Initialized

id check the state of the control for initialized, that seems to be when its executing but im not sure.
0
 
TJ_EngAuthor Commented:
Done that already thanks, doesn't seem to change state.
0
 
NBrownohCommented:
what i would do is this

do until ScriptControl1.State <> Initialized
    doevents
loop
ScriptControl1.Reset
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now