Jump to content

boyd108

Members
  • Posts

    6
  • Joined

  • Last visited

Everything posted by boyd108

  1. Ah, that worked perfectly! Thank you for the suggestion. _IEFormElementOptionSelect($oIEProject, "Test", 1, "byText", 0)
  2. I have a series of options on an IE page that I set using _IEFormElementOptionselect. On their own, each one works perfectly fine, but for some reason, there is one that if I set it using _IEFormElementOptionselect, it resets another field back to it's default. This only occurs with these two options. The other ones are unaffected either way. My code looks like this: $oIEProject = _IEGetObjByName($oIE, "ctl00$ctl00$SubMasterContents$MainContent$ddlMilestone") $oIEVer = _IEGetObjByName($oIE, "ctl00$ctl00$SubMasterContents$MainContent$ddlVersion") $oIETeam = _IEGetObjById($oIE, "ddlFeature") $oIEModule = _IEGetObjByName($oIE, "ctl00$ctl00$SubMasterContents$MainContent$ddlModule") $oIEPriority = _IEGetObjByName($oIE, "ctl00$ctl00$SubMasterContents$MainContent$ddlPriority") $oIERepro = _IEGetObjByName($oIE, "ctl00$ctl00$SubMasterContents$MainContent$ddlReproducibility") _IEFormElementOptionSelect($oIEProject, "Test", 1, "byText") _IEFormElementOptionSelect($oIEVer, 1, 1, "byIndex") _IEFormElementOptionSelect($oIETeam, $oTeam, 1, "byText") _IEFormElementOptionSelect($oIEModule, $oModule, 1, "byText") _IEFormElementOptionSelect($oIEPriority, $oPriority, 1, "byText") _IEFormElementOptionSelect($oIERepro, $oRepro, 1, "byText") Whenever I run the line for $oIEPRoject line, it makes it so I can't set the $oIETeam one. In reverse order, it will just reset the $oIETeam one. Any ideas?
  3. The top portion that iterates through retrieving $data1 and $data2 is still incredibly slow. That is where I need to most help changing my code. for $x=2 to $rowsDiffUsed $guidNum = _ExcelReadCell($openDiff, $x, 1) $data1 = $openSnapshot.Application.WorksheetFunction.VLOOKUP( $guidNum, $openSnapshot.Range("A1:G80000"), 7, FALSE ) $data2 = $openSnapshot.Application.WorksheetFunction.VLOOKUP( $guidNum, $openSnapshot.Range("A1:G80000"), 6, FALSE ) _ExcelWriteCell($newDiff, $data1, $x, 2) ;Item Name _ExcelWriteCell($newDiff, $data2, $x, 3) ;Item ID Next
  4. Wow I made it far more complicated than I needed. I didn't $cell.Value would work. I thought I needed to reference $openDiff.Application.etc first. Thanks! That solved my problem. As to my code being wrong or poorly written when using the UDF, this is the code I was using before. for $x=2 to $rowsDiffUsed $guidNum = _ExcelReadCell($openDiff, $x, 1) $data1 = $openSnapshot.Application.WorksheetFunction.VLOOKUP( $guidNum, $openSnapshot.Range("A1:G80000"), 7, FALSE ) $data2 = $openSnapshot.Application.WorksheetFunction.VLOOKUP( $guidNum, $openSnapshot.Range("A1:G80000"), 6, FALSE ) _ExcelWriteCell($newDiff, $data1, $x, 2) ;Item Name _ExcelWriteCell($newDiff, $data2, $x, 3) ;Item ID $changeCell = 4 for $i=6 to $colsDiffUsed $data3 = _ExcelReadCell($openDiff, $x, $i) if not $data3 = "" Then if _ExcelReadCell($newDiff, $x, $changeCell) = "" Then _ExcelWriteCell($newDiff, _ExcelReadCell($openDiff, 1, $i) & $data3, $x, $changeCell) Else $changeCell = $changeCell + 1 _ExcelWriteCell($newDiff, _ExcelReadCell($openDiff, 1, $i) & $data3, $x, $changeCell) EndIf EndIf Next Next
  5. I should note, I will not use UDFs for this. The UDFs are too slow for the file sizes this is intended for. I used UDFs before, but it took over an hour for a 20k line file. I absolutely must write this using VBA in AutoIt. Sorry to make it so difficult
  6. Hello, I'm attempting to loop through a selection in Excel written with VBA. I select a range of cells and then select all non-blank cells in that range. So far, so good. I then run a For loop through the selection.The intended result is that for each cell in the selection, the value of the first cell in the current column will be appended to the front of the cell. The loop runs for the number of items selected, but I am having trouble having it run on each cell in the selection. Instead, it just runs the whole thing on the first active cell of the selection, writing something like $header1$$header1$$header1$$header1$$header1$$header1$$header1$$header1$$header1$$header1$cell1 What I need to know is how do I reference the next cell in the selection as I loop through? The below code is wrong, I know, because it produces the result above. I'm not sure what to replace ActiveCell with or how to modify this. Thanks for your help! $openDiff.ActiveWorkbook.Sheets(1).Range("F2", $openDiff.Application.Selection.SpecialCells(11)).Select $openDiff.Application.Selection.SpecialCells(2,23).Select For $cell in $openDiff.Application.Selection $openDiff.Application.ActiveCell.Value = $openDiff.Application.Cells(1, $openDiff.Application.ActiveCell.Column).Value & $openDiff.Application.ActiveCell.Value Next
×
×
  • Create New...