Excel blows up after removing procedures

jhanasik

New Member
Joined
Apr 3, 2002
Messages
15
I have an extensively programmed workbook that gets deployed to multiple locations. One of the users discovered a few programming errors that were not discovered in testing and they need to be corrected. The corrections need to occur at the remote locations as opposed to them sending their books to me. I created a workbook to update the books in the remote locations. The method I am using is to open the book to be fixed, rename the main module, delete all of the procedures from the renamed main module, import a new (corrected) main module. Now, one would ask, why is he doing it that way, just delete the original module and import the new. I tried that. The delete of the module seemed to work properly but only after I slowed down the program or else the import seemd to occur before the delete was complete which caused duplicate procedure names and cause VBA to blow up. Thought I had this resolved but when I sent out the fix it still did not delete the original module out in the field and caused the duplicate procedures. This is why I chose to just rename the original module and delete all of the procedures. It works fine except----I like to keep track of updates so when I open the book to be fixed I unhide a particular sheet, change an unused cell to indicate that the update has been performed, hide the sheet, replace the code, save the book, and then excel blows up on the ActiveWorkbook.Close. If I remove the code that unhides the sheet and changes the cell content, everything works fine. Anyone have any idea why just changing a sheet's cell value would cause excel to croak following module/procedure replacement?
 

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
Never mind, I found the problem. Evidently, since I was changing a sheet AND replacing procedures/macro, Excel apparently did not like me doing it in that order. I changed my update programming to replace the procedures/macro first, then change the sheet to reflect that the update has been performed and the ActiveWorkbook.Close performed normally. Seems strange to me, but it worked.
 
Upvote 0

Forum statistics

Threads
1,215,616
Messages
6,125,860
Members
449,266
Latest member
davinroach

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