ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Crashes when I delete Control (https://www.excelbanter.com/excel-programming/293368-crashes-when-i-delete-control.html)

Darren Hill[_2_]

Crashes when I delete Control
 
[Excel 2000]
I have a form containing a button that I no longer need. After running
CodeCleaner, I delete this button, compile the project and save.
When I then start up the form, a macro runs to initialise a class module -
and crashes at the line:

For each Ctl in frmManager.Controls

When I shut down excel and start up again, the file will not open.

If I don't delete the button (which incidentally is not part of the
aforementioned class group), it works fine.

Has anyone any suggestions - this is driving me mad!

Darren





onedaywhen

Crashes when I delete Control
 
Have you tried exporting the form, removing it from the project, then
re-importing the form from file?

--

"Darren Hill" wrote in message ...
[Excel 2000]
I have a form containing a button that I no longer need. After running
CodeCleaner, I delete this button, compile the project and save.
When I then start up the form, a macro runs to initialise a class module -
and crashes at the line:

For each Ctl in frmManager.Controls

When I shut down excel and start up again, the file will not open.

If I don't delete the button (which incidentally is not part of the
aforementioned class group), it works fine.

Has anyone any suggestions - this is driving me mad!

Darren


Darren Hill[_2_]

Crashes when I delete Control
 
Yes, unfortunately the error still occurred.
What I have just tried is - create a new form. Copy all the controls except
the problem one over to it. Copy all Code over. Save. Delete old form. Save.
Shut down. Boot up. Pray the file opens. Yess!! Rename new form to old form.
Save.
At the moment it seems to have worked.

--
Darren
"onedaywhen" wrote in message
...
Have you tried exporting the form, removing it from the project, then
re-importing the form from file?

--

"Darren Hill" wrote in message

...
[Excel 2000]
I have a form containing a button that I no longer need. After running
CodeCleaner, I delete this button, compile the project and save.
When I then start up the form, a macro runs to initialise a class

module -
and crashes at the line:

For each Ctl in frmManager.Controls

When I shut down excel and start up again, the file will not open.

If I don't delete the button (which incidentally is not part of the
aforementioned class group), it works fine.

Has anyone any suggestions - this is driving me mad!

Darren





All times are GMT +1. The time now is 01:13 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com