cedrIck Posted March 13, 2007 Posted March 13, 2007 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.. =)
Ram Posted March 13, 2007 Posted March 13, 2007 (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 March 13, 2007 by Ram
cedrIck Posted March 13, 2007 Author Posted March 13, 2007 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..
JohnBailey Posted March 13, 2007 Posted March 13, 2007 Seems like this was resolved, but I'm curious . Why did you not want to use ShellExecute for this? A decision is a powerful thing
Hendy Posted March 15, 2007 Posted March 15, 2007 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}")
Ram Posted March 26, 2007 Posted March 26, 2007 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..!!
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now