I'm trying to interface with Edge in VB Net 2022 program. I have a program written the program in VBA, so I have most of the work done as far as the code goes. This only serves the purpose of interfacing with our work website, so I don't need to worry about all the different options/controls. we are attempting to close records that are ready to close, but not by a human as there are over 7,000 records to close
. I have the getelementid/getelementclass, ect. working.
I just need a valid object to manipulate the website. In VBA this is my code and all I need to do is replace the IE call, my guess I may run into other issues but this is what I feel is all I need.
Anyone know how to launch Edge and get an object for it to manipulate the page(s)?
. I have the getelementid/getelementclass, ect. working.
I just need a valid object to manipulate the website. In VBA this is my code and all I need to do is replace the IE call, my guess I may run into other issues but this is what I feel is all I need.
Anyone know how to launch Edge and get an object for it to manipulate the page(s)?
Code:
Public Function LoadBrowser() As Boolean
Dim bStatus As Boolean
'Handle any erros we may have cleanly
On Error GoTo Err_Hndlr
' AbortRun = False
If (bDoDebug) Then
Debug.Print ("clsIIE [LoadBrowser Enter]")
End If
Set m_oBrowser = New InternetExplorerMedium
' Set m_oBrowser = New InternetExplorer
UpdateProgressBar
Sleep (200)
'Assume success
bStatus = False
'Initially keep the Browser hidden
m_oBrowser.Visible = False
DoEvents
'Navigate to URL
m_oBrowser.navigate cURL
BrowserWait
UpdateProgressBar
Sleep (100) 'disabled
'Now let's display the window
m_oBrowser.Visible = True
Clean_Exit:
If (bDoDebug) Then
Debug.Print ("clsIIE [LoadBrowser Exit]")
End If
LoadBrowser = bStatus
Exit Function
Err_Hndlr:
Dim nErr As Integer
Dim szErr As String
Set m_oBrowser = Nothing
nErr = Err.LastDllError
szErr = "Error occured for the following reason [" & Err.Description & "]"
If (bDoDebug) Then
Debug.Print (szErr)
Call m_Error_Log.WriteError("LoadBrowser", szErr)
End If
bStatus = True
Err.Clear
Resume Next
End Function