How to stop VBA when opening workbook

missingsc

New Member
Joined
Mar 14, 2024
Messages
27
Office Version
  1. 365
Platform
  1. Windows
  2. Web
So I did something dumb and included a function that runs when the workbook opens, and in doing so introduced an infinite loop error upon opening the book. Since the loop never breaks, I can't get in to edit my code. I tried using the File > Open >hold shift and open file method, didn't work. I tried opening Excel in safe mode, also didn't work. The workbook still opens, the code runs, and it gets locked up.

Anyone know of another method that can halt code from being run when opening the workbook so that I can fix my blunder?
 

Excel Facts

Show numbers in thousands?
Use a custom number format of #,##0,K. Each comma after the final 0 will divide the displayed number by another thousand
How about temoporarily changing your VBA/Macros settings in Excel to one of the "Disable VBA macros..." options before trying to open the workbook?

1738609373311.png
 
Upvote 1
Solution
Phew, thank you! Fiddled with the trust center settings and allowed it to start up and do some edits, and backup a version now without my code. :)

Thank you!
 
Upvote 0
You are welcome.
Glad I was able to help!
 
Upvote 0

Forum statistics

Threads
1,226,466
Messages
6,191,196
Members
453,646
Latest member
SteenP

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