Search code examples
excelvbauserform

Userform won´t load after "software" update


I made a VBA Project with 2 userforms in a verison of Office 365. But after an recent update (new computer with new installation of Office) the userforms cant be loaded. I have not been able to spot the diffrence between the Excel versions as all the versionnumbers match eachother.

I thought it was a problem with the datepicker control but error presistes even after that control is removed. I have also verified that Excel is of 32 bit verison on both computers

Option Explicit
Public Sub Menu() <-Shortcut runs this
    UserForm2.Show
End Sub

Private Sub UserForm_Initialize() <-Userform2 Initializes
        Set UF = New UserForm1 <- Error
       Do stuff in UserForm2
End Sub

When the datepicker control was in the UserForm1 the error recived was:

Could not read some objects since they are´nt availible on this computer

Followed by

Complie error in hidden modul UserForm1.
Error usally shows when the code is incomapitble 
with the app version, platform or architecture.

These are the reference for the Project:

VBA
Excel 16 Obj. Lib.
OLE Automation
Office 16 Obj. Lib.
Forms 2 Obj. Lib.
Common Controls-2 6.0 (SP6)

My knowledges limt has been reached as I thought that this is was 64 bit issue. If I remove the datepicker control from UserForm1 it only shows the second error.


Solution

  • If you google for it you will find e.g. this:

    Download the MSCOMCTL.ocx in Microsoft Download.

    On search menu / Cortana search command prompt and run it as administrator by right clicking it.

    Copy the MSCOMCTL.ocx file to C:\Windows\SysWOW64.

    Navigate the command prompt to the location C:\Windows\SysWOW64 and type regsvr32 mscomctl.ocx.

    Do regsvr32 both mscomctl.ocx and mscomct2.ocx