Jump to content
Sign in to follow this  

Problem AutoitX using in Excel 2003

Recommended Posts


Hi all,

I am facing a strange problem on using AutoitX.dll (

I should run many codes and function from Autoit normally in Excel 2003

When I code as below

$ctrl = ControlGetHandle("Source","","SysListView321")
ControlListView("Source", "", $ctrl, "select all")

$name = ControlListView("Source", "", $ctrl, "finditem", "0 KB",1)
MsgBox(0,"First name",ControlListView("Source","",$ctrl,"GetText",$name, 0))

It runs normally directly compile and run by autoit3

But when I code in Excel with autoitx.dll

Dim cAutoit As New AutoItX3Lib.AutoItX3

Dim infosheet As Worksheet
'Set infosheet = ThisWorksheets.Sheets("Sheet1")

Dim ctrl
Dim data

cAutoit.WinActivate ("Source")
cAutoit.WinWaitActive ("Source")
ctrl = cAutoit.ControlGetHandle("Source", "", "SysListView321")
data = cAutoit.ControlListView("Source", "", ctrl, "FindItem", "3 KB", 1)

MsgBox 0, vbInformation, "Checking", "", data

It seems the data always return "0"

The row of the item "3 KB" should be at row 7, but the function still return a value "0".

And I try to Finditem which not exist in the list, it still return "0". (which should be return -1)

Can anyone help me or anyone face the same problem so we can dicuss it here?

Share this post

Link to post
Share on other sites

Seems no one wanna to answer....

Can anyone help me?

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