How to resolve "Error 429 ActiveX component can't create object " in VBA for EXCEL
Posted on 2007-03-23
Im working on Excel Apllication using VBA.Im got a pice of code from experts exchange regarding to BROWSE button in VBA(i-e similar to windows browse button to open files).
Now my Problem is that i the macro i have written works fine for my Pc but when i run the macro in some other Machine, it gives me the following error when i try to click the Browse Button
"Error 429 ActiveX component can't create object "
Here is my piece of code that i tool from from other thread over here.
Function browseForFile() As String
On Error GoTo err_openFiledialog
Dim myDialog As Object
Set myDialog = CreateObject("MSComDlg.CommonDialog")
myDialog.CancelError = True 'Catch the cancel button as an error
myDialog.MaxFileSize = 255
browseForFile = myDialog.Filename
Me.txtFileName = myDialog.Filename
Set myDialog = Nothing
If Err.Number = 32755 Then 'cancel was selected
browseForFile = ""
MsgBox Err.Description, vbOKOnly + vbExclamation, "Error: " & Err.Number, Err.HelpFile, Err.HelpContext
'Clean up object
If Not myDialog Is Nothing Then Set myDialog = Nothing
I have tried registering the Comdlg32.ocx in other machines and also tried copying th file from my Pc to other but still the macro gives me error.
Could anyone help me with this please? It really Urgent and i need to make sure the macro runs perfectly in all the Client Machines