#include #include #include #include #include #include Global $oIE Global $g_sTxt = "" ; Create application object and open an example workbook Local $oExcel = _Excel_Open() If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_RangeRead Example", "Error creating the Excel application object." & @CRLF & "@error = " & @error & ", @extended = " & @extended) Local $oWorkbook = _Excel_BookOpen($oExcel, @ScriptDir & "\" & "Production_Failure_20150820.xlsx") If @error Then MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_BookOpen Example", "Error opening workbook '" & @ScriptDir & "Production_Failure_20150820.xlsx'." & @CRLF & "@error = " & @error & ", @extended = " & @extended) _Excel_Close($oExcel) Exit EndIf Local $aExcelData = _Excel_RangeRead($oWorkbook, Default, Default, Default) Local $sLastRow = UBound($aExcelData, $UBOUND_ROWS) MsgBox($MB_SYSTEMMODAL, "Check", "Last Row =" & $sLastRow) ; ***************************************************************************** ; Read data from a single cell on the active sheet of the specified workbook ; ***************************************************************************** For $i = 3 To $sLastRow Local $sBPName = _Excel_RangeRead($oWorkbook, Default, "C" & $i) If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_RangeRead Example 1", "Error reading from workbook." & @CRLF & "@error = " & @error & ", @extended = " & @extended) Local $PID = _Excel_RangeRead($oWorkbook, Default, "D" & $i) If @error Then Exit MsgBox($MB_SYSTEMMODAL, "Excel UDF: _Excel_RangeRead Example 1", "Error reading from workbook." & @CRLF & "@error = " & @error & ", @extended = " & @extended) If $sBPName = "MailboxAS2SendSyncMDN" Or $sBPName = "MailboxAS2SendAsyncMDN" Then MailboxAS2($i, $PID) Next Func MailboxAS2($iRow, $sStr) Local $vBool = False ; Attempt to attach to an existing browser displaying a particular website URL otherwise Create a new browser and navigate to that site if one does not already exist Local $oIE = _IECreate("http://10.1.28.190:5010/ws/BPMonitor?bpid=" & $sStr & "&next=page.bpdetail&pos=0&where=live", 1, 1, 1, 1) Local $oTable = _IETableGetCollection($oIE, 7) Local $aTableData = _IETableWriteToArray($oTable) Local $aTableHTML = _IETableWriteToArrayHTML($oTable) _ArrayTranspose($aTableData) _ArrayDisplay($aTableData) _ArrayTranspose($aTableHTML) _ArrayDisplay($aTableHTML) EndFunc ;==>MailboxAS2