How to fix error 429 with Internet explorer
This error occurred when we used get object method to automate the Microsoft Access application or Microsoft office application. This error occurred due to the running instance of MS application not registered. The instance of MS application not registered automatically because it is better to optimization process. But for using get object method we have to register the object in register object table using coding. Using coding we can register or focus the control to our application. In this article we are using shell windows. In this article we also the current page name on the internet explorer.
Firstly we have to understand this error and how this error will occur. "Error Run time 429 Active X component can't create object" occurred due to this line.
Set IEBrowser = GetObject(, "InternetExplorer.Application")
For reproduce this write above code on button click. The error 429 occurred as shown in Fig 1.1.
For solve this error we are using the shell window method. For that we have to create the form to represent the error status and on button click we have to call the function. For using shell window we have to declare as given in code.
Dim WinShell As SHDocVw.ShellWindows
Set WinShell = New SHDocVw.ShellWindows
After coding we have to click on the button. Accidently we got error "user defined type not define" as shown in Fig 1.2.
In the coding part we are using the internet controls. This error occur because of internet control are not registered. So we have to register the Microsoft internet controls as shown in Fig 1.3.
As we add the reference the error will solve and now we have to test whether it will show the current internet explorer page name on message box. So we have to click on the button the name of the page will come on message box as shown in Fig 1.4.
VBA code to reproduce the Error 429:
Option Compare Database Private Sub Command0_Click() Set IEBrowser = GetObject(, "InternetExplorer.Application") End Sub
VBA code to fix the Error 429:
Option Compare Database Private Sub cmdBtn_Click() Dim IEBrowser As InternetExplorer Navigate_IE IEBrowser If Not IEBrowser Is Nothing Then MsgBox IEBrowser.Document.Title End If End Sub Public Function Navigate_IE(ByRef IEBrowser) As Boolean Dim WinShell As SHDocVw.ShellWindows Dim IE As SHDocVw.InternetExplorer Dim lng As Long Dim ObjFnd As Boolean Set WinShell = New SHDocVw.ShellWindows For lng = 0 To WinShell.Count - 1 Set IE = WinShell.Item(lng) If Not IE Is Nothing Then If InStr(1, IE.LocationURL, "file://", vbTextCompare) = 0 And Len(IE.LocationURL) <> 0 Then If IE.Visible = True Then ObjFnd = True: Exit For End If End If Next If ObjFnd = True Then Set IEBrowser = IE IENavigate = True Else IENavigate = False End If End Function
It is advised that the information provided in the article should not be used for any kind formal or production programming purposes as content of the article may not be complete or well tested. Access Guru will not be responsible for any kind of damage (monetary, time, personal or any other type) which may take place because of the usage of the content in the article.
Copyright © 2019 ERP Makers