ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Odd Behaviour with Sub (https://www.excelbanter.com/excel-programming/374657-odd-behaviour-sub.html)

NewBike

Odd Behaviour with Sub
 
I have a sub:
sub complete()
that is located within a module containing other subs before and after it.
The other subs are set to run automatically with a workbook_open event. This
last sub I run manually after the other ones have completed and I have
received the last piece of info needed to compile.

The problem is when I select the Complete sub using the Run Macro button, it
starts to run but keeps popping up "Code Execution has been Interupted"
error, even though nothing else is running.

Any ideas on why this is happening??

John Coleman

Odd Behaviour with Sub
 
Well, if you are sure that nothing else is running then you must have a
bug in Sub Complete(). Obviously, you have not given enough information
to say what the bug is. Try to isolate where the bug is and post
relevant code.


NewBike wrote:
I have a sub:
sub complete()
that is located within a module containing other subs before and after it.
The other subs are set to run automatically with a workbook_open event. This
last sub I run manually after the other ones have completed and I have
received the last piece of info needed to compile.

The problem is when I select the Complete sub using the Run Macro button, it
starts to run but keeps popping up "Code Execution has been Interupted"
error, even though nothing else is running.

Any ideas on why this is happening??



John Coleman

Odd Behaviour with Sub
 

John Coleman wrote:
Well, if you are sure that nothing else is running then you must have a
bug in Sub Complete(). Obviously, you have not given enough information
to say what the bug is. Try to isolate where the bug is and post
relevant code.


I did some reading in this newsgroup, and it seems that inexplicable
"Code execution has been interrupted" messages tend to come from VBA
code which has become (due to an Excel bug) somehow corrupted. The
recommended course of action in this case seems to be to download and
run the much-acclaimed "VBA Code Cleaner" by Rob Bovey:

http://www.appspro.com/

Hope that helps

-John Coleman


NewBike wrote:
I have a sub:
sub complete()
that is located within a module containing other subs before and after it.
The other subs are set to run automatically with a workbook_open event. This
last sub I run manually after the other ones have completed and I have
received the last piece of info needed to compile.

The problem is when I select the Complete sub using the Run Macro button, it
starts to run but keeps popping up "Code Execution has been Interupted"
error, even though nothing else is running.

Any ideas on why this is happening??




All times are GMT +1. The time now is 12:11 PM.

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