Certain methods stop procedure execution without notification

  • Thread starter Thread starter mrbarritt
  • Start date Start date
M

mrbarritt

I have been noticing that when using VBA in Excel, certain methods can cause
the termination of a subroutine without any warning. Some of these are:

Cells.EntireRow.Hidden
Range("O3:AQ3").MergeCells = False
Columns("AD").Insert Shift:=xlToRight, CopyOrigin:=Null

Has anyone else had a similiar experience or know why?
 
If your code is in a UDF, called from a cell, code will simply stop if there
is an error (unless there is an error handler). Also UDFs cannot change the
interface as all the code you posted attempts to do (errors aside).

Regards,
Peter T
 
change the VBA option to stop on all errors using the following menu

Tools - Opions - General - Break on all errors

I also recommend removing all ON ERROR statements until you get the code
working so yo cna actually find the real problems. the On Eror statements
often mask where the real errors arre occuring because excel doesn't break on
the actual statement where the error is occuring it will break some place
else in the code.
 
Back
Top