Jump to content
Sign in to follow this  
Guest Matt

Setting options with AutoItX3

Recommended Posts

Guest Matt

This must be a really simple answer but I can't get it :D

How do you set AutoItX options in V3? So far I have

Set oAutoit = WScript.CreateObject("AutoItX3.Control")

oAutoit.AutoItSetOption("WinTitleMatchMode", 2)

However, I get an error about it expecting an "=" somewhere. Oh,

Share this post


Link to post
Share on other sites
Jon

VBScript is funny about calling methods/functions. When you save the return value you need brackets, otherwise you don't:

result = oAutoit.AutoItSetOption("WinTitleMatchMode", 2)

or

oAutoit.AutoItSetOption "WinTitleMatchMode", 2

Share this post


Link to post
Share on other sites
Guest Guest

OK, thanks for that. New problem now then, how about calling it from VBA?

Set oAutoit = WScript.CreateObject("AutoItX3.Control") gives me a "Run time error 424. Object required" error

Share this post


Link to post
Share on other sites
Jon

OK, thanks for that.  New problem now then,  how about calling it from VBA?

Set oAutoit = WScript.CreateObject("AutoItX3.Control") gives me a "Run time error 424.  Object required" error

I don't know VBA, but the WScript will be incorrect (WScript is the WSH/VBScript object not VBA)

Sorry, don't know.

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  

×