Excel forms causing Object required, Run-time error '424'

Sandra2016

New Member
Joined
Aug 29, 2023
Messages
3
Office Version
  1. 365
Platform
  1. Windows
I created a second form for an Excel spreadsheet. When opening the file I received the Object required error. I have tried several things, including creating a third form in which they could select the language or creating buttons on the Excel sheet to select the language (via a module macro) to get around this, nothing is working. The forms are identical except for the language, so one form ends in _EN and the other form in _SP. I have also tried (both to no avail) to unload or hide the other user form when one opens. I have also used Option Explicit for everything. When I use the compile /debug it doesn't find anything. It is only when I open that file that I receive the Object required error. Of course at that point it will not show me where. Any suggestions?
 

Excel Facts

When did Power Query debut in Excel?
Although it was an add-in in Excel 2010 & Excel 2013, Power Query became a part of Excel in 2016, in Data, Get & Transform Data.
You don't get a "debug" option when the error arises? I suspect that the copied form is looking for something that the original form can "see" because that reference was copied over. You could put a break point on the code that is running when the file opens, then step through (F8) until you find the offending part. Or upload a wb copy to a file share and maybe someone will download it to test.
 
Upvote 0
No I don't get a debug option when the error arises (probably due to the VBA having password protection). Also if I open up the VBA and run the same setup through there, it runs perfectly. I'll try removing the password and see if I get a debug.
 
Upvote 0
Update - found the problem. I unprotected the VBA (and should have thought of that sooner), and found that there was code in 'ThisWorkbook' for when it was opened. It was referencing the old form name. I had completely forgotten there was code there.
Thanks for your help.
 
Upvote 0
Exactly the sort of thing I had in mind when I wrote
I suspect that the copied form is looking for something that the original form can "see" because that reference was copied over.
It was seeing a reference to the old form. Glad to see you have a solution.
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,176
Members
453,021
Latest member
Justyna P

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