Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 345
Default Code Execution Interrupted ??

Hi All,
Just got my first 'code execution iterrupted message'.
I'm looking for guidance how on how to track the error down.
There's a ton of code, and the background is below.

It stopped @ The function @ the end of this posting.
The "end with" stmt was yellow.
The big macro that calls the function below has been running well
for months.

I commented the with.. end with and changed the Set Arg = stmt.
Got same message, this time on the If Not Arg stmt.
Ran without the function to see would happen.

The line that 'yellowed' next was the following:
If varname < "" then 'this line
other code
end if

Hmmmm.....
Further examination,
In the addin I'm developing, a pretty big one,
the function is looking for duplicate values.
It executed 7 times OK, and on the 8th, I got the interruption.

More...
I use Rob Bovery's code cleaner about every other day. Tried it, No help.

The 'big' macro that's running is looking at a wrksht
containing LOTS of driving parms for the add-in. I'm loading values
into hundreds of public vars that are used as constants.
The macro is about 2000 lines of code, and has many calls
to other subs and functions.
The parms wrksheet is in a normal Wbk that is referenced to the addin.

The interruption is happening pretty much at the beginning
of the macro.
I had just added another 5 calls and the interruption started.

I'm taking the new calls out. I can put them into a separate macro.
I saw a posting here a KB# on error trapping which I will read next.

Any shortcuts here ?
Just what am I in for in the worst case?
If you need more facts, Please let me know.

Many thanks,
Neal Z



Public Function Find_Row1CF(ByVal Ws As Worksheet, sLookFor As String, _
Col As Integer, FmRow As Long, ToRow As Long, _
bXlWhole As Boolean) As Long

'Return the row of the cell where a string value is found in one column.
'Zero returned if not found. bXlwhole= true= string occupies entire cell.

Dim Arg As Range, WhoOrPrt

If bXlWhole = True Then WhoOrPrt = xlWhole Else WhoOrPrt = xlPart
If FmRow < 1 Then FmRow = 1
If ToRow < 1 Or ToRow MSoMaxRow Then ToRow = MSoMaxRow
'With Ws

Set Arg = Ws.Range(Ws.Cells(FmRow, Col), Ws.Cells(ToRow, Col)) _
.Find(sLookFor, LookIn:=xlValues, lookat:=WhoOrPrt)

'End With
If Not Arg Is Nothing Then Find_Row1CF = Arg.Row
End Function
--
Neal Z
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Code Execution Interrupted ??

That sometimes happens when the procedure is of long duration without any
memory dumps. I don't know how your code is structured, but if you do have
long procedures, then breaking them down into shorter subs might ease the
stress on the system by allowing some memory dump periodically. Can't
guarantee the cause or the cure. Just an opinion.

"Neal Zimm" wrote:

Hi All,
Just got my first 'code execution iterrupted message'.
I'm looking for guidance how on how to track the error down.
There's a ton of code, and the background is below.

It stopped @ The function @ the end of this posting.
The "end with" stmt was yellow.
The big macro that calls the function below has been running well
for months.

I commented the with.. end with and changed the Set Arg = stmt.
Got same message, this time on the If Not Arg stmt.
Ran without the function to see would happen.

The line that 'yellowed' next was the following:
If varname < "" then 'this line
other code
end if

Hmmmm.....
Further examination,
In the addin I'm developing, a pretty big one,
the function is looking for duplicate values.
It executed 7 times OK, and on the 8th, I got the interruption.

More...
I use Rob Bovery's code cleaner about every other day. Tried it, No help.

The 'big' macro that's running is looking at a wrksht
containing LOTS of driving parms for the add-in. I'm loading values
into hundreds of public vars that are used as constants.
The macro is about 2000 lines of code, and has many calls
to other subs and functions.
The parms wrksheet is in a normal Wbk that is referenced to the addin.

The interruption is happening pretty much at the beginning
of the macro.
I had just added another 5 calls and the interruption started.

I'm taking the new calls out. I can put them into a separate macro.
I saw a posting here a KB# on error trapping which I will read next.

Any shortcuts here ?
Just what am I in for in the worst case?
If you need more facts, Please let me know.

Many thanks,
Neal Z



Public Function Find_Row1CF(ByVal Ws As Worksheet, sLookFor As String, _
Col As Integer, FmRow As Long, ToRow As Long, _
bXlWhole As Boolean) As Long

'Return the row of the cell where a string value is found in one column.
'Zero returned if not found. bXlwhole= true= string occupies entire cell.

Dim Arg As Range, WhoOrPrt

If bXlWhole = True Then WhoOrPrt = xlWhole Else WhoOrPrt = xlPart
If FmRow < 1 Then FmRow = 1
If ToRow < 1 Or ToRow MSoMaxRow Then ToRow = MSoMaxRow
'With Ws

Set Arg = Ws.Range(Ws.Cells(FmRow, Col), Ws.Cells(ToRow, Col)) _
.Find(sLookFor, LookIn:=xlValues, lookat:=WhoOrPrt)

'End With
If Not Arg Is Nothing Then Find_Row1CF = Arg.Row
End Function
--
Neal Z

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 François Excel Discussion (Misc queries) 1 February 18th 05 11:06 PM
Code Execution has been Interrupted JPutman Excel Programming 4 August 24th 04 02:17 PM
Code Execution Has been Interrupted Adrian[_7_] Excel Programming 0 July 30th 04 10:02 AM


All times are GMT +1. The time now is 09:11 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"