Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / January 2008

Tip: Looking for answers? Try searching our database.

Macro ends early without error message

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Richard J. Snee - 29 Jan 2008 13:58 GMT
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").Range("A5")

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

Any ideas?
Joel - 29 Jan 2008 14:47 GMT
Comment out the Error statments and fix the errors by testing for them, not
jumping around these errors.

> My macro just stops execution without any error message as if it encountered
> an END statement. It does this at the line     ActiveSheet.Name =
[quoted text clipped - 15 lines]
>
> Any ideas?
Richard J. Snee - 29 Jan 2008 18:52 GMT
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.

> Comment out the Error statments and fix the errors by testing for them, not
> jumping around these errors.
[quoted text clipped - 18 lines]
> >
> > Any ideas?
Joel - 29 Jan 2008 18:56 GMT
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.

> Perhaps I do not understand what you want me to do but...
>
[quoted text clipped - 26 lines]
> > >
> > > Any ideas?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.