Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 703
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 292
Default 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
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
Stopping a macro DJ Excel Programming 13 October 22nd 07 06:40 PM
Stopping a Macro Felix Excel Programming 10 August 14th 07 12:20 PM
Stopping a Macro Samir[_3_] Excel Programming 6 March 6th 06 04:14 PM
Stopping a Macro Paul Excel Programming 2 December 7th 05 02:11 PM
My Macro keeps stopping?? Sh0t2bts Excel Programming 5 October 28th 03 03:08 PM


All times are GMT +1. The time now is 10:35 PM.

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

About Us

"It's about Microsoft Excel"