Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code execution has been interrupted
Whenever I run a code, it stops at a point. I could not find obvious
coding errors. If I press F8/F5, or hit the botton "continue", the code gets executed again and more more halt. The following help from VBA does not help, or I don't understant it. Can you please shed a light? Thanks HZ Code execution has been interrupted Code execution can be suspended when necessary. This condition has the following cause and solution: A CTRL+BREAK (Microsoft Windows), ESC (Microsoft Excel) or COMMAND+PERIOD (Macintosh) key combination has been encountered. In the error dialog box, click Debug to enter break mode, Continue to resume, or End to stop execution. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code execution has been interrupted
"Who I Am" wrote in message
oups.com... Whenever I run a code, it stops at a point. I could not find obvious coding errors. If I press F8/F5, or hit the botton "continue", the code gets executed again and more more halt. The following help from VBA does not help, or I don't understant it. Can you please shed a light? This is sometimes a sign of corruption in your VBA code. Download my code cleaner utility from the web site below and run it on your project to see if that will fix it. -- Rob Bovey, Excel MVP Application Professionals http://www.appspro.com/ * Take your Excel development skills to the next level. * Professional Excel Development http://www.appspro.com/Books/Books.htm |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code execution has been interrupted
Thanks a lot, Rob. Now I am working on company's computer, so I cannot
download your code. There are several typos in my original message. After I hit F8/F5, there is no more halt. The following is the piece of my code that causes this problem. The halt happens just after the subtotaling. DataSheet.Activate With ActiveSheet .Range("A2").Select Selection.CurrentRegion.Select Selection.Subtotal GroupBy:=2, Function:=xlCount, TotalList:=Array(1, 30) _ , Replace:=True, PageBreaks:=False, SummaryBelowData:=True .Range("A2").Select For Each c In .Range(.Range("A2"), .Range("A55000").End(xlUp)) c.Activate If WorksheetFunction.IsNumber(ActiveCell) Then ActiveCell.EntireRow.Clear End If Next c .Range("A2").Select End With |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code execution has been interrupted
This still sounds like a potential code corruption issue to me. The code cleaner is just a plain vanilla Excel add-in, so if you can download and install it on your home computer you could just e-mail yourself a copy of the VBACodeCleaner.xla workbook and load it by using File/Open in Excel. -- Rob Bovey, Excel MVP Application Professionals http://www.appspro.com/ * Take your Excel development skills to the next level. * Professional Excel Development http://www.appspro.com/Books/Books.htm "Who I Am" wrote in message oups.com... Thanks a lot, Rob. Now I am working on company's computer, so I cannot download your code. There are several typos in my original message. After I hit F8/F5, there is no more halt. The following is the piece of my code that causes this problem. The halt happens just after the subtotaling. DataSheet.Activate With ActiveSheet .Range("A2").Select Selection.CurrentRegion.Select Selection.Subtotal GroupBy:=2, Function:=xlCount, TotalList:=Array(1, 30) _ , Replace:=True, PageBreaks:=False, SummaryBelowData:=True .Range("A2").Select For Each c In .Range(.Range("A2"), .Range("A55000").End(xlUp)) c.Activate If WorksheetFunction.IsNumber(ActiveCell) Then ActiveCell.EntireRow.Clear End If Next c .Range("A2").Select End With |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code execution has been interrupted
Rob,
I do too get the "Code execution has been interrupted" message, i have already tried your code cleaner (thanks by the way) but i still get it. On my computer the macro works fine, but as i tried to use it on another machine is when i get the problem. The macro is about getting data from a mysql database using the MyODBC driver. Everytime i get this message, the macro can continue, there is no obvious error on the code. Here is a fragment of the code where the macro stops: Sub actores(aux As String) Dim connstring As String Dim query2 As String connstring = "ODBC;DATABASE=DBNotas;DSN=DBNotas;OPTION=0;PWD=no seasmetiche;PORT=0;SERVER=192.168.1.218;UID=NotasE xcel" query2 = "SELECT Id, Nombre FROM Secciones ORDER BY nombre" Sheets("AUX").Cells.Delete With Sheets(aux).QueryTables.Add(Connection:=connstring , Destination:=Sheets("AUX").Range("A1"), Sql:=query2) .name = "Actores" .BackgroundQuery = False .Refresh End With 'Sheets("AUX").Rows(1).Delete End Sub the arrow points at the line with the End With command Thank you very much -- Mariano |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Code execution has been interrupted
Rob Bovey Wrote: This is sometimes a sign of corruption in your VBA code. Download my code cleaner utility from the web site below and run it on your project to see if that will fix it. Rob, I downloaded your CodeCleaner, installed it and ran it. Ironically XL had another interrupt within your code! I 'continued' the code and it ran to the end. Unfortunately the problem persists. Are there any other solutions out there? C. -- Casa ------------------------------------------------------------------------ Casa's Profile: http://www.excelforum.com/member.php...o&userid=27619 View this thread: http://www.excelforum.com/showthread...hreadid=389941 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Code execution has been interrupted | Excel Discussion (Misc queries) | |||
code execution has been interrupted | Excel Discussion (Misc queries) | |||
Code Execution has been Interrupted | Excel Programming | |||
Code Execution Has been Interrupted | Excel Programming |