trying to loop through worksheet.
value of colA in one location and value of colB
goes in another location in extra.
I'm not getting the syntax correct.
Dim xlApp As Object, xlSheet As Object, MyRange As Object
Set xlApp = CreateObject("excel.application")
xlApp.Application.DisplayAlerts = False 'Turn off Warning Messages'
xlApp.Visible = True
xlApp.Workbooks.Open FileName:="C:\Book2.xls"
Set xlSheet = xlApp.activesheet
Set MyRange = xlApp.activesheet.Range("A:B")
Dim Row As Long
With xlApp.ActiveSheet
Set MyRange = .Range("A1:B65536").Resize(xlApp.CountA(.Range("A1:B65536")))
For Row = 1 To MyRange.Rows.Count
Sess0.Screen.PutString MyRange.(A).Value, 4, 18
Sess0.Screen.SendKeys "<ENTER>"
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.PutString MyRange.(B).Value, 21, 13
Sess0.Screen.SendKeys "<ENTER>"
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
End With
Next Row
End Sub
value of colA in one location and value of colB
goes in another location in extra.
I'm not getting the syntax correct.
Dim xlApp As Object, xlSheet As Object, MyRange As Object
Set xlApp = CreateObject("excel.application")
xlApp.Application.DisplayAlerts = False 'Turn off Warning Messages'
xlApp.Visible = True
xlApp.Workbooks.Open FileName:="C:\Book2.xls"
Set xlSheet = xlApp.activesheet
Set MyRange = xlApp.activesheet.Range("A:B")
Dim Row As Long
With xlApp.ActiveSheet
Set MyRange = .Range("A1:B65536").Resize(xlApp.CountA(.Range("A1:B65536")))
For Row = 1 To MyRange.Rows.Count
Sess0.Screen.PutString MyRange.(A).Value, 4, 18
Sess0.Screen.SendKeys "<ENTER>"
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.PutString MyRange.(B).Value, 21, 13
Sess0.Screen.SendKeys "<ENTER>"
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
End With
Next Row
End Sub