• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

WScript Object not recognised

HI All,

I have learnt that WScript object is instrinsic . However when I use the statement
WScript.Sleep 1000, it is throwing an error "Run time error 424: Object required".

Can you let me know if any settings that needs to be set to have WScript object work.
 
Goto VBA (Alt+F11)
Goto the Tools, References menu
Enable Microsoft Scripting Library
 
Hi Huui -Thanks for the response. However, even though I have clicked it, still WScript is not working. Find attached the screenshot. Let me know if I have checked the correct reference library.
 

Attachments

  • Tools-references.png
    Tools-references.png
    221.5 KB · Views: 2
Thanks Hui and Mark for your response. However I could find that Application.wait achieves the same functionality done by WScript.Sleep.
Hence I replace WScript.Sleep with Application.Wait
 
Also, sleep allows for more finite control of pause time (i.e. in milliseconds).

Though Wait is more accurate in terms of time. Sleep uses processor's ticks to calculate time delay and may vary slightly on different machines.
 
Back
Top