Cedes2001 Posted July 31, 2013 Posted July 31, 2013 I have searched the forums and help and read up on _Excel* but I can't seem to figure this one out with my newbie eyes. So I am hoping that one of you will help me out. Here is a snippit of one of my Excel worksheets. I am using *.xls because I saw on the forums issues with *.xlsx. So EXE_VERSION and DATABASE columns will only have one cell under each populated and used only once but from SUFFIX on each cell needs to populate a powerbuilder field or drop-down and then loop to do it again. I have found loops that continue until no data exists but as you can see the cells aren't consistantly populated. EXE_VERSION DATABASE SUFFIX FNAME MI LNAME ADDRESS1 ADDRESS2 CITY STATE ZIP COUNTY EMAIL PHONE_HOME PHONE_HOME_EXT PHONE_OFFICE PHONE_OFFICE_EXT TIME_REACHED GENDER MARITAL_STATUS INCOME LANGUAGE SSN DOB SUPPORT database_name Happy Test 321 Solstice Street Sumter MN 56630 612-555-1414 F Single 154-23-6789 7/19/1953 Funny Test 151 Oak Street Anson TX 79501 US ftest@my_email.com 651-555-1236 5PM M-F M Single 951-62-3847 4/10/1958 Buddy Test 7413 Apple Lane #87 Madison WI 53703 952-641-1234 M Single 123-45-6789 5/7/1948 Nasty Test 1598 York Ave Edina MN 55410 123ntest@email_me.com 320-875-0281 F Single 741-85-2963 6/6/1953 Mrs. Testy Test 82690 Frances Ave Springfield IL 62701 507-476-8413 F Single English 963-85-2741 2/24/1943 Here is some of my coding. I have tried _ExcelReadCell but then understood it isn't going to work for what I need to do here. I saw ARRAYs but it looked like they were stringing the values and I need each one separate. I also tried a copy & paste but it seems to copy but doesn't actually paste anything into the powerbuilder application. Potentially, I could have at least 200 different people for now that would be the largest I think that this would be grabbing and looping through. Any help would be GREATLY appreciated!!! Run(@ProgramFilesDir & "myfolderapplication.exe") ; IDEALY IN THIS PATH WOULD BE THE VARIABLE FOR THE EXE_VERSION #include "c:AutomationIncludeExcel.au3" ; Variable Information $AutoDir = "c:Automation" $sRowExe = "A" $sRowDB = "B" $sRowPeeps = "C" ; list of columns to with important data. This is a comma separated list. ; Open your Excel data spreadsheet Local $sFilePath = $AutoDir & "Questions.xls" Local $oExcel = _ExcelBookOpen($sFilePath) _ExcelSheetActivate($oExcel,"Questions") If @error = 1 Then MsgBox(0, "Error!", "Unable to Create the Excel Object") Exit ElseIf @error = 2 Then MsgBox(0, "Error!", "File does not exist - Shame on you!") Exit EndIf $Executable = _ExcelReadCell($oExcel, $sRowExe + 2, 2) $DatabaseName = _ExcelReadCell($oExcel, $sRowDB + 2, 2) ;$People = _ExcelReadCell($oExcel, $sRowPol + 2, 2) #region --- Enrollment Processing Module - Answer Questions --- Func _WinWaitActivate($title,$text,$timeout=0) WinWait($title,$text,$timeout) If Not WinActive($title,$text) Then WinActivate($title,$text) WinWaitActive($title,$text,$timeout) EndFunc _WinWaitActivate("Enter Database Name - 9.15","") Send ("{DEL 40}") ;ensures that this field is blank prior to data entry Send ($DatabaseName) Send ("{ENTER}") ; THIS SHOULD BE THE START OF MY LOOP STATEMENT THAT I CAN'T FIGURE OUT AND WHERE IT SHOULD START GRABBING FIELD BY FIELD TO POPULATE IN POWERBUILDER MouseClick("left",117,62,1) _WinWaitActivate("Microsoft Excel - Questions.xls [Compatibility Mode]","") Send("{RIGHT}{RIGHT}") ; presses Right Arrow to go to cell to the right Send("{CTRLDOWN}c{CTRLUP}") ; presses CTRL+c to copy cell _WinWaitActivate("Life Search Criteria","") Send ("{TAB}") Send("{CTRLDOWN}v{CTRLUP}") Send ("{TAB}") ;AFTER THIS I WOULD NEED TO POPULATE FNAME, ETC
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