Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 110
Default Code stops for no reason (that I can think of)

I built a short and simple procedure on my PC, tested it, converted it to an
xla, and made a button. I installed this button on a couple of colleagues'
PCs.

On only one PC, when the button is pressed, about a third of the macro runs,
then the debug window shows, saying the code has been interrupted (as if I
had pressed "Ctrl+Break"). If I hit "Continue", it then happily runs the
rest of the code as if no problem ever existed.

Do you know why, on one PC, Excel is acting as if I had pressed "Ctrl +
Break"?

thanks in advance
Daniel
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Code stops for no reason (that I can think of)

I think we will need to see your code (in order to see exactly what you are
doing) before being able to make a guess as to what is going on. If you do
post your code, indicate the line it is stopping on (just in case we can't
duplicate your results on our systems).

--
Rick (MVP - Excel)


"Daniel Bonallack" wrote in
message ...
I built a short and simple procedure on my PC, tested it, converted it to
an
xla, and made a button. I installed this button on a couple of
colleagues'
PCs.

On only one PC, when the button is pressed, about a third of the macro
runs,
then the debug window shows, saying the code has been interrupted (as if I
had pressed "Ctrl+Break"). If I hit "Continue", it then happily runs the
rest of the code as if no problem ever existed.

Do you know why, on one PC, Excel is acting as if I had pressed "Ctrl +
Break"?

thanks in advance
Daniel


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Code stops for no reason (that I can think of)

Vista, Excel 2007, right? We've encountered this and have not yet found a
workaround. Instructions to our users is to just click continue. Still
trying to set it up so it happens consistently so we can report to
Microsoft, but so far it seems pretty random, although with a particular
application it happens very frequently. There's NO reason this should
occur -- I pretty much know what I'm doing and for it to say code execution
has been interrupted on a statement like End Sub is ridiculous!!
I'm afraid you're going to have to just live with it!
Bob Umlas
Excel MVP

"Daniel Bonallack" wrote in
message ...
I built a short and simple procedure on my PC, tested it, converted it to
an
xla, and made a button. I installed this button on a couple of
colleagues'
PCs.

On only one PC, when the button is pressed, about a third of the macro
runs,
then the debug window shows, saying the code has been interrupted (as if I
had pressed "Ctrl+Break"). If I hit "Continue", it then happily runs the
rest of the code as if no problem ever existed.

Do you know why, on one PC, Excel is acting as if I had pressed "Ctrl +
Break"?

thanks in advance
Daniel


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 110
Default Code stops for no reason (that I can think of)

Thanks Rick and Bob,

I should have included this in the original paragraph, but it's actually
Excel 2003, Windows XP.

Here is the first part of the code:

_________________

Sub CreateOutput2()

MsgBox "You will be asked to open a file to check these deals against for
duplicates", vbOKOnly + vbInformation

blnNew = False

sActive = ActiveWorkbook.Name
Application.Dialogs(xlDialogOpen).Show
sCheck = ActiveWorkbook.Name
sCheckSh = ActiveSheet.Name
If sCheck = sActive Then End


The macro stops on the line "sCheck = ActiveWorkBook.Name".

I haven't defined my variables - do you think that could be it?

regards
Daniel

"Bob Umlas" wrote:

Vista, Excel 2007, right? We've encountered this and have not yet found a
workaround. Instructions to our users is to just click continue. Still
trying to set it up so it happens consistently so we can report to
Microsoft, but so far it seems pretty random, although with a particular
application it happens very frequently. There's NO reason this should
occur -- I pretty much know what I'm doing and for it to say code execution
has been interrupted on a statement like End Sub is ridiculous!!
I'm afraid you're going to have to just live with it!
Bob Umlas
Excel MVP

"Daniel Bonallack" wrote in
message ...
I built a short and simple procedure on my PC, tested it, converted it to
an
xla, and made a button. I installed this button on a couple of
colleagues'
PCs.

On only one PC, when the button is pressed, about a third of the macro
runs,
then the debug window shows, saying the code has been interrupted (as if I
had pressed "Ctrl+Break"). If I hit "Continue", it then happily runs the
rest of the code as if no problem ever existed.

Do you know why, on one PC, Excel is acting as if I had pressed "Ctrl +
Break"?

thanks in advance
Daniel



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,939
Default Code stops for no reason (that I can think of)

Have you re-booted the computer where the error is occuring? I have had the
same experience that was fixed with a reboot...
--
HTH...

Jim Thomlinson


"Daniel Bonallack" wrote:

I built a short and simple procedure on my PC, tested it, converted it to an
xla, and made a button. I installed this button on a couple of colleagues'
PCs.

On only one PC, when the button is pressed, about a third of the macro runs,
then the debug window shows, saying the code has been interrupted (as if I
had pressed "Ctrl+Break"). If I hit "Continue", it then happily runs the
rest of the code as if no problem ever existed.

Do you know why, on one PC, Excel is acting as if I had pressed "Ctrl +
Break"?

thanks in advance
Daniel



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Code stops for no reason (that I can think of)

Your code does not "stop" for me, so Jim's suggestion may end of working for
you. I do see a problem in the code you posted, though... you use an End
statement to shut down your code. Over in the compiled VB world I originally
came from, doing that could produce unwanted results (especially if objects
were involved) as the End statement stopped all running code and didn't give
the operating system an opportunity to do automatic (behind the scenes)
clean ups that might be necessary depending on what the code is actually
doing. I'm not sure if the same thing applies to VBA, but I would still not
use End to stop my code. VB has an Exit Sub (also Exit Function for
functions) which closes down running code and it is my understanding that it
allows for any behind the scenes clean ups that may be necessary.

--
Rick (MVP - Excel)


"Daniel Bonallack" wrote in
message ...
Thanks Rick and Bob,

I should have included this in the original paragraph, but it's actually
Excel 2003, Windows XP.

Here is the first part of the code:

_________________

Sub CreateOutput2()

MsgBox "You will be asked to open a file to check these deals against for
duplicates", vbOKOnly + vbInformation

blnNew = False

sActive = ActiveWorkbook.Name
Application.Dialogs(xlDialogOpen).Show
sCheck = ActiveWorkbook.Name
sCheckSh = ActiveSheet.Name
If sCheck = sActive Then End


The macro stops on the line "sCheck = ActiveWorkBook.Name".

I haven't defined my variables - do you think that could be it?

regards
Daniel

"Bob Umlas" wrote:

Vista, Excel 2007, right? We've encountered this and have not yet found a
workaround. Instructions to our users is to just click continue. Still
trying to set it up so it happens consistently so we can report to
Microsoft, but so far it seems pretty random, although with a particular
application it happens very frequently. There's NO reason this should
occur -- I pretty much know what I'm doing and for it to say code
execution
has been interrupted on a statement like End Sub is ridiculous!!
I'm afraid you're going to have to just live with it!
Bob Umlas
Excel MVP

"Daniel Bonallack" wrote in
message ...
I built a short and simple procedure on my PC, tested it, converted it
to
an
xla, and made a button. I installed this button on a couple of
colleagues'
PCs.

On only one PC, when the button is pressed, about a third of the macro
runs,
then the debug window shows, saying the code has been interrupted (as
if I
had pressed "Ctrl+Break"). If I hit "Continue", it then happily runs
the
rest of the code as if no problem ever existed.

Do you know why, on one PC, Excel is acting as if I had pressed "Ctrl +
Break"?

thanks in advance
Daniel




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
Macro stops for no reason Gizmo63 Excel Programming 4 January 21st 08 09:07 PM
Code stops for no apparent reason René[_2_] Excel Programming 4 December 30th 06 09:01 PM
Code breaking without reason Daniel Bonallack Excel Programming 2 October 3rd 06 10:43 AM
Code stops when high lighting (Chips code) ste mac Excel Programming 6 May 2nd 06 01:39 PM
Help... This code consistently crashes for no reason. Yo Excel Programming 3 February 5th 04 09:13 AM


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

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

About Us

"It's about Microsoft Excel"