Certain methods stop procedure execution without notification

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?
 
P

Peter T

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
 
J

Joel

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top