PC Review


Reply
Thread Tools Rate Thread

Code Execution Interrupted ??

 
 
=?Utf-8?B?TmVhbCBaaW1t?=
Guest
Posts: n/a
 
      31st Jul 2007
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 re: 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 With Quote
 
 
 
 
=?Utf-8?B?SkxHV2hpeg==?=
Guest
Posts: n/a
 
      31st Jul 2007
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 re: 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 With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Code Execution has been interrupted Hydra Microsoft Excel Programming 10 9th Nov 2009 02:05 PM
Code execution has been interrupted =?Utf-8?B?QkFD?= Microsoft Excel Programming 0 12th Feb 2007 09:59 PM
Code Execution Has Been Interrupted LCK Microsoft Excel Programming 2 18th Nov 2005 12:25 AM
Code Execution Interrupted Jim Palmer Microsoft Excel Misc 0 15th Nov 2004 10:58 PM
Code Execution Interrupted Jim Palmer Microsoft Excel Misc 0 15th Nov 2004 09:06 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:00 PM.