Jump to content
Sign in to follow this  
Sawyer

Creating AutoItX object in VBA

Recommended Posts

Sawyer

Hi, can someone please help me?

I know the answer must be quite trivial to my question, but I just can't find it anywhere.

I'd like to use AutoItX in a VBA script (Excel). I have registered AutoItX3.dll for COM and referenced it to the worksheet. Also I can see all the AutoItX methods and properties in the object browser. Still when I run the code below I receive a VBA EM saying: "ActiveX component can't create object" (EM Nr 429)

What should I do to make it work?

Thank you very much

Sawyer

Option Explicit

Dim AutoItX As AutoItX3Lib.AutoItX3

Public Function GetAutoItX() As Boolean

GetAutoItX = False

If TypeName(AutoItX) <> "AutoItX3" Then

Set AutoItX = CreateObject(Class:="AutoItX3Lib.AutoItX3")

End If

If TypeName(AutoItX) = "AutoItX3" Then

GetAutoItX = True

End If

End Function

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  

×