Interrupt a faulty function that puts me in an endless loop

lplates

New Member
Joined
Sep 23, 2011
Messages
5
Hello,

I've been looking through a colleague's spreadsheet but have a problem. When I load his spreadsheet into my computer it throws up an error which seems to be related to declaring variables.

But, because the error (if it is an error) is in a function that is called in the main spreadsheet I can't stop it in order to exit the spreadsheet! I end up in an endless loop trying to shut things down!

  1. Computer- "Compile error: Can't find project or library"
  2. Computer switches to VBA editor
  3. I click on OK
  4. I try to shut down VBA editor
  5. Computer- "This command will stop the debugger".
  6. I click on OK
  7. Instantly Computer- "Compile error: Can't find project or library"
  8. and we're back to the beginning.
Trying something different:

  1. Computer- "Compile error: Can't find project or library"
  2. Computer switches to VBA editor
  3. I click on OK
  4. I try to reset the project
  5. Instantly Computer- "Compile error: Can't find project or library"
  6. and we're back to the beginning.
I'm sure there must be some way of stopping this. The only way I've found so far is to fix the code (another topic) so that the function completes each time it's called, or delete the function!

Any help would be appreciated. I've tried searching the Internet and the forum but am not finding anything relevant...
 

Excel Facts

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
I think one of the bugs is that there is a macro (not the function) that links to Microsoft Word, which I don't have. So there is a problem with the References. But I can't get to the References menu before resetting the project, but when I reset the project the function runs and the error kicks in.
 
Upvote 0
In a blank workbook set macro security to disable all macros, then try opening the problem workbook.
 
Upvote 0
Not quite so simple as I had trusted the document before (so macros were always enabled for that document) but I cleared my trusted documents list, re-opened the file and chose to not enable macros. Which unfortunately means I can't step through the macros to debug it. So, I've disabled Macros, opened the workbook, cleared the cells that call the user defined function, saved it under a different name, opened that new workbook with macros enabled. Which seems to let me step through the macros and hasn't caused me the problem yet... Thanks for your help,
In a blank workbook set macro security to disable all macros, then try opening the problem workbook.
 
Upvote 0

Forum statistics

Threads
1,215,461
Messages
6,124,954
Members
449,198
Latest member
MhammadishaqKhan

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