Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default Code Execution has been interrupted

Still having a problem with this.
As long as I hit the continue button, the code executes perfectly.

It is running a loop with a find statement in it, and then it writes the
data to an array vaiable. That is where it ususally, but not always hands up.

I tried putting in a wait statement so it could catch up, but no luck.

It executes the loop 3,4, 5, 6 times, and then hangs up.

Any more suggestions?
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default Code Execution has been interrupted

I added a couple of dummy statements after the find statement, that don't
affect the code (move to the next cell and thn move back) and I have the same
problem.

In other words it seems to hang up after the find statement.

"Hydra" wrote:

Still having a problem with this.
As long as I hit the continue button, the code executes perfectly.

It is running a loop with a find statement in it, and then it writes the
data to an array vaiable. That is where it ususally, but not always hands up.

I tried putting in a wait statement so it could catch up, but no luck.

It executes the loop 3,4, 5, 6 times, and then hangs up.

Any more suggestions?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Code Execution has been interrupted

Based on past experience try shutting XL down and opening it up again. Not
just the spreadsheet but the entire application. That normally fixes it for
me.
--
HTH...

Jim Thomlinson


"Hydra" wrote:

Still having a problem with this.
As long as I hit the continue button, the code executes perfectly.

It is running a loop with a find statement in it, and then it writes the
data to an array vaiable. That is where it ususally, but not always hands up.

I tried putting in a wait statement so it could catch up, but no luck.

It executes the loop 3,4, 5, 6 times, and then hangs up.

Any more suggestions?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 897
Default Code Execution has been interrupted

How about, post your code?

--JP

On Sep 25, 3:10*pm, Hydra wrote:
Still having a problem with this.
As long as I hit the continue button, the code executes perfectly.

It is running a loop with a find statement in it, and then it writes the
data to an array vaiable. *That is where it ususally, but not always hands up.

I tried putting in a wait statement so it could catch up, but no luck.

It executes the loop 3,4, 5, 6 times, and then hangs up.

Any more suggestions?

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default Code Execution has been interrupted

the code is huge but I can show part of it. I'e already broken it into
pieces, but maybe I can do more.

No dice on the other. I can reboot the pC and still have the same problem.

-------------------------------------------

Set Myrange = Worksheets("Sheet1").Range("A1: A" & nrows)

'Count the number of summary rows in the sheet and make sure you are
back to the first cell
NumberOfSummaries = Application.WorksheetFunction.CountIf(Myrange,
"SUMMARY:")
'MsgBox ("Number of WBS Elements = " & NumberOfSummaries)
Range("a1").Select


'Redimension the variables to hold all the values needed for the sumaries
ReDim WBSNOS(NumberOfSummaries) 'Variable to hold WBS Numbers
ReDim WBSROW(NumberOfSummaries) ' VAriable to hold the Row Number for
the Summaries
ReDim Addr(NumberOfSummaries) ' Variable to hold the Address for the row
with data needed.


'-------------------Fill the Data arrays for Cost locations

'Run this loop once for each WBS Item Searching for the word "Summary"
'Summary Rows contain the WBS Number
For Counter = 1 To NumberOfSummaries

Cells.Find(What:="SUMMARY:", After:=ActiveCell, LookIn:= _
xlFormulas, LookAt:=xlPart, SearchOrder:=xlByRows,
SearchDirection:= _
xlNext, MatchCase:=False, SearchFormat:=False).Activate

' First find the Summary Row and record the WBS number
' And the Row Number for the Summary Row
WBSNOS(Counter) = ActiveCell.Offset(0, 1).Value
WBSROW(Counter) = ActiveCell.Row

'Then find the Next row that contains the words "Total Price"
Cells.Find(What:="Price", After:=ActiveCell, LookIn:= _
xlValues, LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:= _
xlNext, MatchCase:=False, SearchFormat:=False).Activate



'Record the Address for the Total Price Row
ActiveCell.Offset(0, 1).Select
ActiveCell.Offset(0, -1).Select
Addr(Counter) = ActiveCell.Address


--------------------------------------------------------------------------------


This last line is where it usuallly hangs up. Then hit the continue button
and off you - for another four or five loops.


"Sheet 1" is around 4000 lines and 72 columns.

"JP" wrote:

How about, post your code?

--JP

On Sep 25, 3:10 pm, Hydra wrote:
Still having a problem with this.
As long as I hit the continue button, the code executes perfectly.

It is running a loop with a find statement in it, and then it writes the
data to an array vaiable. That is where it ususally, but not always hands up.

I tried putting in a wait statement so it could catch up, but no luck.

It executes the loop 3,4, 5, 6 times, and then hangs up.

Any more suggestions?




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Code Execution has been interrupted

I'm not sure about what's going on but put this at the beginning of your
code:
Application.EnableCancelKey = xlDisabled

--
Toby Erkson
Excel 2003, WinXP

"Hydra" wrote in message
...
Still having a problem with this.
As long as I hit the continue button, the code executes perfectly.

It is running a loop with a find statement in it, and then it writes the
data to an array vaiable. That is where it ususally, but not always hands
up.

I tried putting in a wait statement so it could catch up, but no luck.

It executes the loop 3,4, 5, 6 times, and then hangs up.

Any more suggestions?



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default Code Execution has been interrupted

Here is a new twist.

Running a different macro against another file, I'm now getting the same
disruption, where I never have before.



"JP" wrote:

How about, post your code?

--JP

On Sep 25, 3:10 pm, Hydra wrote:
Still having a problem with this.
As long as I hit the continue button, the code executes perfectly.

It is running a loop with a find statement in it, and then it writes the
data to an array vaiable. That is where it ususally, but not always hands up.

I tried putting in a wait statement so it could catch up, but no luck.

It executes the loop 3,4, 5, 6 times, and then hangs up.

Any more suggestions?


  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 38
Default Code Execution has been interrupted

Magic.

That worked perfectly, Thank You.

Now what I'd like to know, is how does one ever learn such a thing, and even
if you knew it existed, how would you look it up after you forgot the command
name?





"Just Another Yahoo!" wrote:

I'm not sure about what's going on but put this at the beginning of your
code:
Application.EnableCancelKey = xlDisabled

--
Toby Erkson
Excel 2003, WinXP

"Hydra" wrote in message
...
Still having a problem with this.
As long as I hit the continue button, the code executes perfectly.

It is running a loop with a find statement in it, and then it writes the
data to an array vaiable. That is where it ususally, but not always hands
up.

I tried putting in a wait statement so it could catch up, but no luck.

It executes the loop 3,4, 5, 6 times, and then hangs up.

Any more suggestions?




  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10
Default Code Execution has been interrupted

Very good question!

At a contract job I had the same issue as you, seemingly random code
breaking for no reason. Typically it required me to reboot my machine.
Just lived with it. Now at my current (full-time...yeay!) job I was
scanning the code of my predecessor and noticed that clause. I asked him
what it was all about. Apparently he was having the same issue of odd
program breaks and this was the solution he found after some searching.

I'm not an Excel MVP so if one of them will chime in it would be appreciated
(hint hint). What I know from it is, it disables the Escape key (Esc). Why
this works I do not know, particularly when you and I both know that we
never even hit the Esc key and it is virtually impossible that we even could
consistently hit the same line of code!

Everyone, please use the Help functionality of the VBE editor to find out
what this command does. Basically, it allows the Esc key to be disabled.
The bad thing is, you can't use the Esc key to STOP the execution of the
code! Yikes! The good thing is, you don't have to re-enable it at the end
of your code because Excel will default to turning the Esc key back on
(whew!).

As to remembering it, well, documentation. I keep a folder with me at work
or (when I was contracting) on a jump drive of useful code snippets and
tips/tricks. Use a descriptive file name since 8 character file names are
soooo Win95 ago! I also have a list of MVP web sites that I search as well
since they have good, exact, and working code that is normally well
documented ;-)

I'm glad I was finally able to help someone. Too bad this couldn't be made
a "sticky" like what's done in forums.
--
Toby Erkson
Excel 2003, WinXP

"Hydra" wrote in message
...
Magic.

That worked perfectly, Thank You.

Now what I'd like to know, is how does one ever learn such a thing, and
even
if you knew it existed, how would you look it up after you forgot the
command
name?





"Just Another Yahoo!" wrote:

I'm not sure about what's going on but put this at the beginning of your
code:
Application.EnableCancelKey = xlDisabled

--
Toby Erkson
Excel 2003, WinXP

"Hydra" wrote in message
...
Still having a problem with this.
As long as I hit the continue button, the code executes perfectly.

It is running a loop with a find statement in it, and then it writes
the
data to an array vaiable. That is where it ususally, but not always
hands
up.

I tried putting in a wait statement so it could catch up, but no luck.

It executes the loop 3,4, 5, 6 times, and then hangs up.

Any more suggestions?






  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Code Execution has been interrupted

Hi Guys

I have had the same problem for the last 2 days.
This is simply what I found.
I had an add-in from INet.
IConnect added to my sheet.
Every time the add-in updated a price on the sheet te code would give the above error.
I deleted the link from edit links and what do you know. No more error.

Hope this helps.

Thanks




Hydra wrote:

Code Execution has been interrupted
25-Sep-09

Still having a problem with this.
As long as I hit the continue button, the code executes perfectly.

It is running a loop with a find statement in it, and then it writes the
data to an array vaiable. That is where it ususally, but not always hands up.

I tried putting in a wait statement so it could catch up, but no luck.

It executes the loop 3,4, 5, 6 times, and then hangs up.

Any more suggestions?

Previous Posts In This Thread:

EggHeadCafe - Software Developer Portal of Choice
Transfer Session State From Classic ASP to ASP.NET
http://www.eggheadcafe.com/tutorials...-state-fr.aspx


  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default Code Execution has been interrupted

Thanks for the info. I have seen other postings where certain virus
protection can cause similar problems.


<Stathi Anagnostatos wrote in message ...
Hi Guys

I have had the same problem for the last 2 days.
This is simply what I found.
I had an add-in from INet.
IConnect added to my sheet.
Every time the add-in updated a price on the sheet te code would give the
above error.
I deleted the link from edit links and what do you know. No more error.

Hope this helps.

Thanks




Hydra wrote:

Code Execution has been interrupted
25-Sep-09

Still having a problem with this.
As long as I hit the continue button, the code executes perfectly.

It is running a loop with a find statement in it, and then it writes the
data to an array vaiable. That is where it ususally, but not always hands
up.

I tried putting in a wait statement so it could catch up, but no luck.

It executes the loop 3,4, 5, 6 times, and then hangs up.

Any more suggestions?

Previous Posts In This Thread:

EggHeadCafe - Software Developer Portal of Choice
Transfer Session State From Classic ASP to ASP.NET
http://www.eggheadcafe.com/tutorials...-state-fr.aspx



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Code Execution Has Been Interrupted? alondon Excel Programming 0 March 4th 07 05:52 PM
Code execution has been interrupted BAC Excel Programming 0 February 12th 07 09:59 PM
Code execution has been interrupted Stuart C Excel Programming 3 March 23rd 06 09:02 AM
code execution has been interrupted del Excel Discussion (Misc queries) 0 September 3rd 05 12:22 PM


All times are GMT +1. The time now is 04:24 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"