Hello to All!!
I'm trying to automate the writing of Oracle SQL-Plus Insert statements and I'm having a problem with the "_ExcelSheetUsedRangeGet" function in _ExcelCom. I reviewed the function comments and thought I was using it correctly, but it always seems to return a zero for the number of rows. The code that I'm using is below. As I said, I keep getting "0" returned for the last row number and I'm positive that there are 15 rows used in the sheet. I apperciate any help I can get with this.
Thanks & have a great day,
PJ
Local $oExcel = _ExcelBookOpen($Get_In_Fyle, 1)
Dim $Num_Rows[4]
$CurrRow = 1
$Record_Cnt = 0
$Num_Rows = _ExcelSheetUsedRangeGet($oExcel, 1)
SplashTextOn("DeBug","Last Cell Used " & $Num_Rows[0] & @CRLF & "Last Cell Used " & $Num_Rows[1] & @CRLF & "Last Col Used " & $Num_Rows[2] & @CRLF & "Number of rows = " & $Num_Rows[3], 500, 200, -1, 50, 4, "", 12)
Sleep(300)
MsgBox(4096,"DeBug", "Number of rows = " & $Num_Rows[3])
; MsgBox(4096,"DeBug", "Control Number = " & $Ctrl_No)
For $Cell = 1 to $Num_Rows[3]
$Ctrl_No = _ExcelReadCell($oExcel, $Cell, 1)
MsgBox(4096,"DeBug", "Control # = " & $Ctrl_No & @CRLF & "Cell # = " & $Cell& @CRLF & "Number of rows = " & $Num_Rows[3])
FileWriteLine($Insert_Fyle,"Insert into Reset_Tmp_CNUM (C_Num) values ('" & $Ctrl_No & "')" & @CRLF)
$Record_Cnt = $Record_Cnt + 1
Next
; And finally we close out
_ExcelBookClose($oExcel)
FileClose($Insert_Fyle)
MsgBox(4096,"Insert Create", "Insert file created -- " & $Record_Cnt & " records written!")