PDA

View Full Version : Error 429 on Show Userform during Open Workbook



zest1
10-16-2006, 07:18 AM
I get a Runtime error 429 ?ActiveX component can?t create object? upon opening a workbook and userform (automatically), at this line:

UserForm1.Show vbModeless
I have a ?file selector? userform that has command buttons to select and open related files. Clicking the ?x? on the userform closes the workbook (without saving). The error happens when opening the workbook after having closed via the userform. But opening the workbook after having closed it via the workbook does NOT generate the error.

I tried ?load userform1? and ?UserForm1.Repaint? but no luck. I suspect the problem is in the following code that I?m using for the userform to close the workbook:


Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
ThisWorkbook.Close True
End Sub

I also tried ?If CloseMode = 0 Then ThisWorkbook.Close? and ?ActiveWorkbook.Close True? with no luck (I?d prefer to use ?ThisWorkbook? rather then ?ActiveWorkbook).

Also, after using the userform to select and open the file, I?d like to have that file come to the front, unobstructed by the userform. I found and am using some cool code that minimizes the form and creates a taskbar icon for it.

Any help with this would be greatly appreciated.

gnod
10-16-2006, 07:35 AM
how about try to install the latest MDAC from microsoft.. :think:

lucas
10-16-2006, 08:13 AM
I commented out the autoopen code and uncommented this code in the thisworkbook module:

Private Sub Workbook_Open()
UserForm1.Show vbModeless
End Sub


I cannot duplicate your problem using Excel 2003. Version could be the problem.