Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5932453
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T14:50:10+00:00 2026-05-22T14:50:10+00:00

Possible Duplicate: Excel VBA App stops spontaneously with message “Code execution has been halted”

  • 0

Possible Duplicate:
Excel VBA App stops spontaneously with message “Code execution has been halted”

Why does VBA execution stop at random points within the code with the message “Code execution has been interrupted” unless the following has been specified:

Application.EnableCancelKey = xlDisabled

The stop in the code is similar to a Ctrl+Break key stroke and hence, disabling the Cancel Key (Ctrl+Break) avoids the stop in the execution.

However, disabling the Cancel Key is a bad idea for me because certain scenarios in my code can cause infinite loops (If an OLE request never completes for example) where the ability to use Ctrl+Break is priceless.

I am not too keen on setting EnableCancelKey to xlErrorHandler either. It would be better if I could understand the reason for the code interruption and avoid it rather than changing the behavior of the Cancel Key.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T14:50:11+00:00Added an answer on May 22, 2026 at 2:50 pm

    It’s most likely a corruption of the p-code that’s created when you compile. Some people have had success by choose Clear All Breakpoints from the Debug menu. The rock solid method is to export all of your modules, delete them, then reimport them. This round trip through plain text forces a complete rebuild of the p-code. Google for Rob Bovey’s Code Cleaner for a free utility that automates this process.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: “Least Astonishment” in Python: The Mutable Default Argument Edit: This has nothing
Possible Duplicate: When should I use “using” blocks in C#? A lot of classes
Possible Duplicate: running sql statement from excel vba Here's the excerpt that's causing the
Possible Duplicate: How to refresh/load RTD Bloomberg function (BDH) in excel in vba I
Possible Duplicate: Create Excel file in Java How to save output in excel format
Possible Duplicate: How to properly clean up Excel interop objects in C# I've read
Possible Duplicate: What Ruby IDE do you prefer? I've generally been doing stuff on
Possible Duplicate: How do you send email from a Java app using Gmail? How
Possible Duplicate: python: creating excel workbook and dumping csv files as worksheets How would
Possible Duplicate: How to properly clean up Excel interop objects in C# I've this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.