Two 'ThisWorkbook' objects in one VBAProject...PLEASE HELP

Gahagan

New Member
Joined
Feb 27, 2002
Messages
12
I imported a file *.cls which was a 'ThisWorkbook' object in another project in order to copy the code (don't ask why). In doing so I forgot to then remove the imported one. Now, there are two 'ThisWorkbook' objects, and XL 97 crashes whenever I open the workbook. For whatever reason, it doesn't crash in XL 2002, which is what I'm (trying) to develop this app in.

Does anyone know a way to get into the guts of this project and remove the second 'ThisWorkbook' object??

Thank you SO much for any help,
Gahagan
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
first thing. if you cant open a up the owrkbook then open a blankworkbook and isable the macros.

then go into your VBA and objects property and delete the macro from in there.

if the macro is on a button then make sure the buttons address doesnt read
-workbook!macro1
it should just have the macro name.

(hope this helps a bit)
 
Upvote 0
I tried that too, but thanks!

Usually I would right-click the object and click 'remove x...' but that option is disabled for the 2nd 'ThisWorkbook' object.

2002 doesn't allow programmatic removal of VBComponents through the VBA Extensible reference; 97 does but only if the Workbook would open long enough to do it...!

AAAHHHH!

I guess I'll start over. Thanks anyway!
Gahagan
 
Upvote 0
I am a 97 user,
and find that some of my macros intermoittently reopen the current file. and then my excel crashes too.

the only solution i found was to make sure i chenged the macro link so as not to include the file name and then save the change.

sorry. I have no ideas.. 97 deffinitely has bugs.
All the best.
 
Upvote 0

Forum statistics

Threads
1,214,520
Messages
6,120,003
Members
448,935
Latest member
ijat

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