View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Neal Zimm Neal Zimm is offline
external usenet poster
 
Posts: 345
Default Error than Aborted Excel

Hi All,

sHold = sHold & sColData & Space(MaxLenAy(iSortOrder) - Len(sColData))
Debug.Print sHold
sHold = ""

The lines above are part of a proc that prints evenly 'lined-up' columns.
Due to a bug, the Space math worked out to -2. The bug is now fixed,

BUT, Excel ENDED with the "Excel has a problem and has to close..."
display and my files were recovered. (No On Error .... code was in
place at the time.)

1. There was no run-time error. Why ?

When I extracted parts of the code to debug it, in testing the fix
I got a run- time error with a negative number.

2. Without putting all the code here, can you tell me what might be
the difference between getting a run-time error or not ?

3. Do you know of any other "common" uses of VBA that will abort Excel
without a run-time error so I can take special care with them?

Thanks,
Neal
--
Neal Z