Button suddenly failing to load userform

RockandGrohl

Well-known Member
Joined
Aug 1, 2018
Messages
789
Office Version
  1. 2010
Platform
  1. Windows
Hi all,

Since last week, this was working and absolutely nothing has changed. We have three buttons to load userforms. One of them is a control panel to load various buttons that execute macros and this works totally fine.

The other two are done when there is an active cell selected. It takes the information on that row and loads data, last week these were working as they have been for the last several years, but today it seems like they are broken inexplicably. No changes to the core working structure of this sheet have been made, or really any changes at all, since last week.

When I press either button, I get "Run Time Error 440, Automation Error" displayed.

Here is the code:

VBA Code:
Sub cpopen()

Load ControlPanel
ControlPanel.Show

End Sub

Sub pupopen()

Load PUpCheckBox
PUpCheckBox.Show

End Sub

Sub pcopen()

Load PCodeCheck
PCodeCheck.Show

End Sub

It's the PUpCheckBox and PCodeCheck that aren't working. When I mouse-over the name, it says "Object Variable or With Block variable not set"

The userforms are there and 100% correctly named in the object information window.


I loaded the 2019 version of this same sheet and confirmed the macros and userforms are set up 100% identically, yet this sheet has no problem loading the forms.
 

Excel Facts

Easy bullets in Excel
If you have a numeric keypad, press Alt+7 on numeric keypad to type a bullet in Excel.
In the VB Editor goto Tools > options > General & check the box marked "Break in Class Module" and then try to run the code.
 
Upvote 0
In the VB Editor goto Tools > options > General & check the box marked "Break in Class Module" and then try to run the code.

Hi Fluff, good to see you.

Tried this and it shows the exact same behaviour - I click the button and it says Automation Error, with "PUpCheckBox" highlighted in yellow, and mousing over Load PUpCheckBox gives me the "Object Variable or With Block Variable not set" message.
 
Upvote 0
If you comment out the Load line, do you get the same error when you try to show it?
 
Upvote 0
Are the userforms in the same workbook as the buttons?
 
Upvote 0
Are the userforms in the same workbook as the buttons?

Yep, there is one module which I pasted above, the rest of the code is contained within the buttons in the control panel, or the two checking userforms which I am having problems with.
 
Upvote 0
In that case I don't know. I cannot recreate that error.
 
Upvote 0
In that case I don't know. I cannot recreate that error.

Hi Fluff,

I've just created a new module, copied the content over and then the code. Deleted the old "PCodeCheck" and tried to rename the new "UserForm1" to "PCodeCheck"

It says "Path/file access error"

Another clue?
 
Upvote 0
If you check the references are any listed as Missing?
 
Upvote 0

Forum statistics

Threads
1,214,929
Messages
6,122,317
Members
449,081
Latest member
tanurai

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top