Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Macro ends early without error message

My macro just stops execution without any error message as if it encountered
an END statement. It does this at the line ActiveSheet.Name =
"Paste_Buffer"

On Error Resume Next
Application.DisplayAlerts = False
ActiveWorkbook.Sheets("Paste_Buffer").Delete
Application.DisplayAlerts = True
On Error GoTo 0
ActiveWorkbook.Sheets.Add
ActiveSheet.Name = "Paste_Buffer"

Set RSMEU_BufferSht = ActiveSheet
Set RSMEU_ToRange =
Workbooks(RSMEU_InUse).Sheets("Paste_Buffer").Rang e("A5")

Sometimes it works fine. Other times it refuses to work.

Any ideas?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Macro ends early without error message

Comment out the Error statments and fix the errors by testing for them, not
jumping around these errors.

"Richard J. Snee" wrote:

My macro just stops execution without any error message as if it encountered
an END statement. It does this at the line ActiveSheet.Name =
"Paste_Buffer"

On Error Resume Next
Application.DisplayAlerts = False
ActiveWorkbook.Sheets("Paste_Buffer").Delete
Application.DisplayAlerts = True
On Error GoTo 0
ActiveWorkbook.Sheets.Add
ActiveSheet.Name = "Paste_Buffer"

Set RSMEU_BufferSht = ActiveSheet
Set RSMEU_ToRange =
Workbooks(RSMEU_InUse).Sheets("Paste_Buffer").Rang e("A5")

Sometimes it works fine. Other times it refuses to work.

Any ideas?

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Macro ends early without error message

Perhaps I do not understand what you want me to do but...

I trace the code in break mode a step at a time. Execution just stops. No
errors of any kind. It does not go into break mode. If I stop (via a break)
before the problem line and use the Debug menu to skip over it, the next line
works but what the skipped line does is essential to my macro so if I comment
it out my macro does not do what I intend.


"Joel" wrote:

Comment out the Error statments and fix the errors by testing for them, not
jumping around these errors.

"Richard J. Snee" wrote:

My macro just stops execution without any error message as if it encountered
an END statement. It does this at the line ActiveSheet.Name =
"Paste_Buffer"

On Error Resume Next
Application.DisplayAlerts = False
ActiveWorkbook.Sheets("Paste_Buffer").Delete
Application.DisplayAlerts = True
On Error GoTo 0
ActiveWorkbook.Sheets.Add
ActiveSheet.Name = "Paste_Buffer"

Set RSMEU_BufferSht = ActiveSheet
Set RSMEU_ToRange =
Workbooks(RSMEU_InUse).Sheets("Paste_Buffer").Rang e("A5")

Sometimes it works fine. Other times it refuses to work.

Any ideas?

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default Macro ends early without error message

The On Error Resume Next doesn't tell you when you hit an error it just
executes the next line as if nothing is wrong. Comment out this statement
and see if you get an error.

"Richard J. Snee" wrote:

Perhaps I do not understand what you want me to do but...

I trace the code in break mode a step at a time. Execution just stops. No
errors of any kind. It does not go into break mode. If I stop (via a break)
before the problem line and use the Debug menu to skip over it, the next line
works but what the skipped line does is essential to my macro so if I comment
it out my macro does not do what I intend.


"Joel" wrote:

Comment out the Error statments and fix the errors by testing for them, not
jumping around these errors.

"Richard J. Snee" wrote:

My macro just stops execution without any error message as if it encountered
an END statement. It does this at the line ActiveSheet.Name =
"Paste_Buffer"

On Error Resume Next
Application.DisplayAlerts = False
ActiveWorkbook.Sheets("Paste_Buffer").Delete
Application.DisplayAlerts = True
On Error GoTo 0
ActiveWorkbook.Sheets.Add
ActiveSheet.Name = "Paste_Buffer"

Set RSMEU_BufferSht = ActiveSheet
Set RSMEU_ToRange =
Workbooks(RSMEU_InUse).Sheets("Paste_Buffer").Rang e("A5")

Sometimes it works fine. Other times it refuses to work.

Any ideas?

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
Error Not Displaying, Instead macro just ends J@Y Excel Programming 5 August 15th 07 03:48 PM
Execution ends without error message in middle of program Richard J. Snee Excel Programming 3 June 11th 07 05:37 AM
Error or Unexpected Behavior with Office Automation when you use early binding Barb[_5_] Excel Programming 3 September 15th 04 03:17 PM
Code ends subroutine in error Mike[_58_] Excel Programming 3 November 20th 03 12:54 AM
Loop ends early BrianB Excel Programming 0 August 15th 03 12:13 PM


All times are GMT +1. The time now is 06:51 AM.

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"