View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Jim Cone Jim Cone is offline
external usenet poster
 
Posts: 3,290
Default Macros skip steps and/or stops in the middle of code

On Error Resume Next ignores errors.
At the least, error handling can tell you what error occurred,
although Excel can sometimes just "quit" even when using error handling.

For starters use something like this to identify the error...

Sub RunAllADS()
On Error GoTo Err_Handler
'your code
Exit Sub
Err_Handler:
MsgBox Err.Num & vbCR & Err.Description
End Sub
'-------------------------------------

and maybe there is something in these...
http://support.microsoft.com/kb/210684/en-us
"Copying worksheet programmatically causes run-time error 1004 in Excel"
http://support.microsoft.com/kb/903240/en-us
Description of the Excel 2003 post-Service Pack 2 hotfix package: November 7, 2005
http://support.microsoft.com/kb/177634/en-us
XL97: Copy Method of Sheets Object Causes Invalid Page Fault
--
Jim Cone
San Francisco, USA
http://www.officeletter.com/blink/specialsort.html




wrote in message
Do you mean "On Error Resume Next"? No here's the code
---------------------------------------------------------------------------
Sub RunAllADS()

ADSTriangleCheck
LossLimitCredibility
LFMStates
CauseGroup
Cause
PartofBody
Location
LocationGroup
Tenure
Month
Day
Time
Age
ReportLagGroup
LossLayer
ManualClassCode
StateAccident
StateBureau
StateJurisdiction
End Sub
-snip-