Vladiedoo
06-30-2013, 12:42 PM
Hi, I'm new to VBA and have experience in Java.
I was wondering why the following code gave me "Run-time error '424': Object required" when I try to call the IEQuit function.
Function GetIE() As Object
Set GetIE = CreateObject("InternetExplorer.Application")
End Function
Sub Test()
Dim IE As Object
Set IE = GetIE
With IE
.navigate "link" 'Link to any website goes here.
.Visible = True
End With
Do While IE.Busy
Application.Wait DateAdd("s", 1, Now)
Loop
IEQuit (IE)
End Sub
Function IEQuit(ByRef inet As Object)
inet.Quit
End Function
Thank you in advance for your help and time.
I was wondering why the following code gave me "Run-time error '424': Object required" when I try to call the IEQuit function.
Function GetIE() As Object
Set GetIE = CreateObject("InternetExplorer.Application")
End Function
Sub Test()
Dim IE As Object
Set IE = GetIE
With IE
.navigate "link" 'Link to any website goes here.
.Visible = True
End With
Do While IE.Busy
Application.Wait DateAdd("s", 1, Now)
Loop
IEQuit (IE)
End Sub
Function IEQuit(ByRef inet As Object)
inet.Quit
End Function
Thank you in advance for your help and time.