' Make Excel visible on the screen
objExcel.Visible = True
' Create a new Workbook
Set objWorkBook = objExcel.Workbooks.Open("C:\Users\*******\Desktop\testcopy.xlsx")
Do
Sess0.Screen.WaitHostQuiet (g_HostSettleTime)
gs = Sess0.Screen.GetString (03, 13, 06) 'Gets sup name
objWorkBook.WorkSheets("Sheet1").Cells(r,1).Value = gs 'Transfers case number to Excel
gs = Sess0.Screen.GetString (14, 19, 11) 'auditor
objWorkBook.WorkSheets("Sheet1").Cells(r,2).Value = gs 'Transfers auditor to Excel
gs = Sess0.Screen.GetString (14, 48, 10) 'Gets aud name
objWorkBook.WorkSheets("Sheet1").Cells(r,3).Value = gs 'Transfers supervisor to Excel
Sess0.Screen.Sendkeys("")
Sess0.Screen.WaitHostQuiet (g_HostSettleTime)
r=r+1
Loop Until objWorkBook.WorkSheets("Sheet1").Cells(r,1).Value = ""
' Excel will remain open after this Sub ends.
' To close out Excel, unremark the following 4 lines of code. .
objExcel.ActiveWorkBook.Save
'objWorkBook.Close
'objExcel.Quit
'set objWorkBook = Nothing
'set objExcel = Nothing
So I'm working with the above code. I simply want to capture some info on a screen, and paste it into different columns. However, the excel file will be added to. So what I want to do it to check each row for a blank cell in Column 1, and if the cell is blank, then paste the information in that row. It the cell already has data, then move to the next row. I can Get info to the workbook, but I'm not sure how to check for a new empty row in the workbook to pate the info into.
Thanks in advance!!
objExcel.Visible = True
' Create a new Workbook
Set objWorkBook = objExcel.Workbooks.Open("C:\Users\*******\Desktop\testcopy.xlsx")
Do
Sess0.Screen.WaitHostQuiet (g_HostSettleTime)
gs = Sess0.Screen.GetString (03, 13, 06) 'Gets sup name
objWorkBook.WorkSheets("Sheet1").Cells(r,1).Value = gs 'Transfers case number to Excel
gs = Sess0.Screen.GetString (14, 19, 11) 'auditor
objWorkBook.WorkSheets("Sheet1").Cells(r,2).Value = gs 'Transfers auditor to Excel
gs = Sess0.Screen.GetString (14, 48, 10) 'Gets aud name
objWorkBook.WorkSheets("Sheet1").Cells(r,3).Value = gs 'Transfers supervisor to Excel
Sess0.Screen.Sendkeys("")
Sess0.Screen.WaitHostQuiet (g_HostSettleTime)
r=r+1
Loop Until objWorkBook.WorkSheets("Sheet1").Cells(r,1).Value = ""
' Excel will remain open after this Sub ends.
' To close out Excel, unremark the following 4 lines of code. .
objExcel.ActiveWorkBook.Save
'objWorkBook.Close
'objExcel.Quit
'set objWorkBook = Nothing
'set objExcel = Nothing
So I'm working with the above code. I simply want to capture some info on a screen, and paste it into different columns. However, the excel file will be added to. So what I want to do it to check each row for a blank cell in Column 1, and if the cell is blank, then paste the information in that row. It the cell already has data, then move to the next row. I can Get info to the workbook, but I'm not sure how to check for a new empty row in the workbook to pate the info into.
Thanks in advance!!