Sign in to follow this  
Followers 0
cedrIck

Control ID

6 posts in this topic

Hi everyone. I have a question. Lets say i try to open Microsoft Excel and i want to open a file from there.

Run("C:\Program Files\Microsoft Office\OFFICE11\EXCEL.EXE")
WinWaitActive("C:\Program Files\Microsoft Office\OFFICE11\EXCEL.EXE","",1)
Send("^o")
Sleep("1000")
$sFolder = 'C:\Documents and Settings\operator\My Documents\niew\'
ControlSetText('Open', '', 'RichEdit20W2', $sFolder) 
ControlClick('Open', '', 'Button1')

Normally for others programs such as Notepad and when i want to save or open a file, the Control ID, ClassNameNN, Text, Style and ExStyle values are all shown on the AutoIt v3 Active Window Info. But Microsoft applications such as Microsoft Excel, i've tried to open file and it came out a open dialog box. when i use my mouse to point over the (Look in:) icon, the AutoIt v3 Active Window Info doesn't shown any values. So how can i type my address into the (Look in:) icon so that i can extract my file from the correct folder??...thanks if anyone can help me..thanks.. =)

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Hi everyone. I have a question. Lets say i try to open Microsoft Excel and i want to open a file from there.

Run("C:\Program Files\Microsoft Office\OFFICE11\EXCEL.EXE")
WinWaitActive("C:\Program Files\Microsoft Office\OFFICE11\EXCEL.EXE","",1)
Send("^o")
Sleep("1000")
$sFolder = 'C:\Documents and Settings\operator\My Documents\niew\'
ControlSetText('Open', '', 'RichEdit20W2', $sFolder) 
ControlClick('Open', '', 'Button1')

Normally for others programs such as Notepad and when i want to save or open a file, the Control ID, ClassNameNN, Text, Style and ExStyle values are all shown on the AutoIt v3 Active Window Info. But Microsoft applications such as Microsoft Excel, i've tried to open file and it came out a open dialog box. when i use my mouse to point over the (Look in:) icon, the AutoIt v3 Active Window Info doesn't shown any values. So how can i type my address into the (Look in:) icon so that i can extract my file from the correct folder??...thanks if anyone can help me..thanks.. =)

Instead try using Filename box in the same window and put your full location wherever the file is saved. Looks like the ClassName for Filename is "RichEdit20W2".. Hope this helps!! Edited by Ram

Share this post


Link to post
Share on other sites

Instead try using Filename box in the same window and put your full location wherever the file is saved. Looks like the ClassName for Filename is "RichEdit20W2".. Hope this helps!!

Thanks Ram! I've tried it and it works!.. Thanks! =) cheers..

Share this post


Link to post
Share on other sites

Seems like this was resolved, but I'm curious :whistle:. Why did you not want to use ShellExecute for this?


A decision is a powerful thing

Share this post


Link to post
Share on other sites

Thanks Ram! I've tried it and it works!.. Thanks! =) cheers..

Hum dont see how above code can work:

Run("C:\Program Files\Microsoft Office\OFFICE11\EXCEL.EXE")

WinWaitActive("Microsoft Excel","","")

Send("^o")

WinWait("Open","","")

$sFolder = @MyDocumentsDir & "\Work\Job schedule.xls"

ControlSend("Open", "", "RichEdit20W2", $sFolder & "{ENTER}")

Share this post


Link to post
Share on other sites

Hum dont see how above code can work:

Run("C:\Program Files\Microsoft Office\OFFICE11\EXCEL.EXE")

WinWaitActive("Microsoft Excel","","")

Send("^o")

WinWait("Open","","")

$sFolder = @MyDocumentsDir & "\Work\Job schedule.xls"

ControlSend("Open", "", "RichEdit20W2", $sFolder & "{ENTER}")

Tested your code.. it works fine..!!

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  
Followers 0