centralpressure Posted October 6, 2009 Share Posted October 6, 2009 I have a simple script where I am importing a text file from the desktop into Excel, but it hangs up at the data source selection screen. I can't seem to figure out why. At first I thought it was my computer, so I tested it on another machine and same problem. There is a spot where I am tabbing 7 times to get the data source to select from the desktop, it appears as though the tabbing stops on 'Cancel' and the screen hangs there. Below is a portion of the script, thanks for any thoughts. Run("C:\Program Files\Microsoft Office\Office11\Excel.exe") WinwaitActive("Microsoft Excel - Book1") Send("!d") WinWaitActive("Microsoft Excel - Book1") Send("d") Send("d") WinWaitActive("Select Data Source") Send("{TAB 7}") Send("{Down}") Send("{Enter}") Send("all") Send("{Enter}") WinWaitActive("Text Import Wizard - Step 1 of 3") Send("n") Send("n") Send("n") Send("F") Send("{Enter}") WinWaitActive("Microsoft Excel - Book1") Send("^a") Link to comment Share on other sites More sharing options...
rliiack Posted October 6, 2009 Share Posted October 6, 2009 (edited) I would say your title on WinWaitActive maybe wrong. Did you find the title by using Au3info? Edited October 6, 2009 by rliiack My Projects:Smart Icons Link to comment Share on other sites More sharing options...
PsaltyDS Posted October 6, 2009 Share Posted October 6, 2009 I have a simple script where I am importing a text file from the desktop into Excel, but it hangs up at the data source selection screen. I can't seem to figure out why. At first I thought it was my computer, so I tested it on another machine and same problem. There is a spot where I am tabbing 7 times to get the data source to select from the desktop, it appears as though the tabbing stops on 'Cancel' and the screen hangs there. Below is a portion of the script, thanks for any thoughts. Run("C:\Program Files\Microsoft Office\Office11\Excel.exe") WinwaitActive("Microsoft Excel - Book1") Send("!d") WinWaitActive("Microsoft Excel - Book1") Send("d") Send("d") WinWaitActive("Select Data Source") Send("{TAB 7}") Send("{Down}") Send("{Enter}") Send("all") Send("{Enter}") WinWaitActive("Text Import Wizard - Step 1 of 3") Send("n") Send("n") Send("n") Send("F") Send("{Enter}") WinWaitActive("Microsoft Excel - Book1") Send("^a") What kind of file are you importing? If it's just a CSV I believe you could just do: $oExcel = _ExcelBookOpen(@DesktopDir & "\MyFile.csv") Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
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