Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Stopping A Macro
I am having a Macro "hang" or I cannot cancel when I run, it has to time
itself out. Here is the code Dim MyPath As String, FilesInPath As String Dim myFiles() As String Dim SourceCcount As Long, FNum As Long Dim mybook As Workbook, BaseWks As Worksheet Dim sourceRange As Range, destrange As Range Dim Cnum As Long, CalcMode As Long MyPath = ThisWorkbook.Worksheets(1).Range("b10") If Right(MyPath, 1) < "\" Then MyPath = MyPath & "\" End If |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Stopping A Macro
On 11 Jul., 03:46, Mike Lewis
wrote: I am having a Macro "hang" or I cannot cancel when I run, it has to time itself out. *Here is the code * Dim MyPath As String, FilesInPath As String * * Dim myFiles() As String * * Dim SourceCcount As Long, FNum As Long * * Dim mybook As Workbook, BaseWks As Worksheet * * Dim sourceRange As Range, destrange As Range * * Dim Cnum As Long, CalcMode As Long * * MyPath = ThisWorkbook.Worksheets(1).Range("b10") * * If Right(MyPath, 1) < "\" Then * * * * MyPath = MyPath & "\" * * End If Hi MyPath = ThisWorkbook.Worksheets(1).Range("b10") .Value Hit CTRL + Break (usually next to "Print Screen") to stop macro Regards, Per |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Stopping A Macro
Is it possible to put it in the macro code somewhere?
"Per Jessen" wrote: On 11 Jul., 03:46, Mike Lewis wrote: I am having a Macro "hang" or I cannot cancel when I run, it has to time itself out. Here is the code Dim MyPath As String, FilesInPath As String Dim myFiles() As String Dim SourceCcount As Long, FNum As Long Dim mybook As Workbook, BaseWks As Worksheet Dim sourceRange As Range, destrange As Range Dim Cnum As Long, CalcMode As Long MyPath = ThisWorkbook.Worksheets(1).Range("b10") If Right(MyPath, 1) < "\" Then MyPath = MyPath & "\" End If Hi MyPath = ThisWorkbook.Worksheets(1).Range("b10") .Value Hit CTRL + Break (usually next to "Print Screen") to stop macro Regards, Per |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Stopping A Macro
No, but maybe it could help to insert a breakpoint in the code. Click
on the line where the macro should be halted and hit F9. Click "Run" to continue the macro. Also look at the other options in the Debug menu. Reards, Per On 11 Jul., 04:31, Mike Lewis wrote: Is it possible to put it in the macro code somewhere? "Per Jessen" wrote: On 11 Jul., 03:46, Mike Lewis wrote: I am having a Macro "hang" or I cannot cancel when I run, it has to time itself out. *Here is the code * Dim MyPath As String, FilesInPath As String * * Dim myFiles() As String * * Dim SourceCcount As Long, FNum As Long * * Dim mybook As Workbook, BaseWks As Worksheet * * Dim sourceRange As Range, destrange As Range * * Dim Cnum As Long, CalcMode As Long * * MyPath = ThisWorkbook.Worksheets(1).Range("b10") * * If Right(MyPath, 1) < "\" Then * * * * MyPath = MyPath & "\" * * End If Hi MyPath = ThisWorkbook.Worksheets(1).Range("b10") .Value Hit CTRL + Break (usually next to "Print Screen") to stop macro Regards, Per- Skjul tekst i anførselstegn - - Vis tekst i anførselstegn - |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Stopping A Macro
Hi Mike
See "CheckKey.zip" at http://www.oaltd.co.uk/Excel/Default.htm for code to abort a macro on keypress. HTH. Best wishes Harald "Mike Lewis" skrev i melding ... Is it possible to put it in the macro code somewhere? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Stopping a macro | Excel Programming | |||
Stopping a Macro | Excel Programming | |||
Stopping a Macro | Excel Programming | |||
Stopping a Macro | Excel Programming | |||
My Macro keeps stopping?? | Excel Programming |