so far I have this code referring from an older one which fetches data from excel and puts it in SAP.
What I was hoping to do was for VBA to fetch the links in excel for IE to navigate in a single window after performing specific tasks.
Sub accounts()
Dim ie As Object
Set ie = CreateObject("internetexplorer.application")
'ShowWindow ie.hwnd, SW_SHOWMAXIMIZED
ie.Visible = True
'Create objects to application, workbook and sheets
Set xclapp = CreateObject("Excel.Application")
Set xclwbk = ActiveWorkbook
Set xclsht = xclwbk.Sheets("accounts")
'Line Reference
line_index = 2
link = ""
'Loop line
Label1:
While Sheets("accounts").Cells(line_index, 1).Value <> ""
'Get websites from Excel
link = xclwbk.Sheets("accounts").Cells(line_index, 1).Value
'Open link
ie.Navigate link
While ie.ReadyState <> 4 Or ie.Busy
DoEvents
Wend
line_index = line_index + 1 'Loop
Application.Wait (Now + TimeValue("0:00:3")) 'wait
Wend
End Sub
It is now opening websites from excel but navigation fails after the 2nd line. Any thoughts?
I'm still trying to study VBA and any help would be appreciated. Thanks!