(Solved) – System.Windows.Forms object stopped being created in Excel VBA project

  • by
(solved)-–-systemwindows.forms-object-stopped-being-created-in-excel-vba-project

I have created a VBA Project in Excel that uses System_Windows_Forms.RichTextBox control.

In VBA Project Editor menu Add-Ins > References I have checked “System_Windows_Forms” reference.

(The path of the reference is C:WindowsMicrosoft.NETFrameworkv4.0.30319System.Windows.Forms.tlb)

This is the VBA Code that now stopped working:

Private Sub mySub()
    Dim dotnetRTFBox As System_Windows_Forms.RichTextBox
    Set dotnetRTFBox = New System_Windows_Forms.RichTextBox

Now, the line beginning with “Set dotnetRTFBox” gives:

Runtime error '429'
ActiveX component can't create object.

I have used this macro every 2-3 months for last 3 years and it worked. Last time I have used it was in 5/2019. But now it gives me the error.

I looked into help page ActiveX component can’t create object or return reference to this object (Error 429). As one of possible reasons it says: The class isn’t registered.

I have used ActiveXHelper and RegDllView from Nirsoft and none of the tools showed System.Windows.Forms.tlb or System.Windows.Forms.dll as being registered even thought that the files does exist in the specified location.

How could I repair it?

(I use 32-bit Office 365 Personal on 64-bit W10 1809, build 17763.864.)

Leave a Reply

Your email address will not be published. Required fields are marked *