Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro stops for no reason | Excel Programming | |||
Code stops for no apparent reason | Excel Programming | |||
Code breaking without reason | Excel Programming | |||
Code stops when high lighting (Chips code) | Excel Programming | |||
Help... This code consistently crashes for no reason. | Excel Programming |