ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Certain methods, such as Cells.EntireRow.Hidden, stop VBA subrouti (https://www.excelbanter.com/excel-programming/433160-certain-methods-such-cells-entirerow-hidden-stop-vba-subrouti.html)

mrbarritt

Certain methods, such as Cells.EntireRow.Hidden, stop VBA subrouti
 
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 a

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?



Chip Pearson

Certain methods, such as Cells.EntireRow.Hidden, stop VBA subrouti
 
Are these lines of code being executed in a VBA procedure that is
directly or indirectly called from a worksheet cell? If so, that is
the problem. Code initiated by a worksheet cell cannot make any
changes to the Excel environment.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)



On Wed, 2 Sep 2009 16:54:19 -0700, rarity
wrote:

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 a

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?


mrbarritt

Certain methods, such as Cells.EntireRow.Hidden, stop VBA subr
 
Chip,
There are two cases for code initiation. One is a button control that I
have placed on a sheet, the other is a custom menu that I have added to the
menu bar. In either case the execution does not involve a worksheet cell.

Mark

"Chip Pearson" wrote:

Are these lines of code being executed in a VBA procedure that is
directly or indirectly called from a worksheet cell? If so, that is
the problem. Code initiated by a worksheet cell cannot make any
changes to the Excel environment.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)



On Wed, 2 Sep 2009 16:54:19 -0700, rarity
wrote:

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 a

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?



Tim Williams[_2_]

Certain methods, such as Cells.EntireRow.Hidden, stop VBA subr
 
Do you have any error handling in your routine?
What setting do you have in the VBE under Tools Options General Error
tracking ?

Tim



"mrbarritt" wrote in message
...
Chip,
There are two cases for code initiation. One is a button control that I
have placed on a sheet, the other is a custom menu that I have added to
the
menu bar. In either case the execution does not involve a worksheet cell.

Mark

"Chip Pearson" wrote:

Are these lines of code being executed in a VBA procedure that is
directly or indirectly called from a worksheet cell? If so, that is
the problem. Code initiated by a worksheet cell cannot make any
changes to the Excel environment.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)



On Wed, 2 Sep 2009 16:54:19 -0700, rarity
wrote:

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 a

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?





mrbarritt

Certain methods, such as Cells.EntireRow.Hidden, stop VBA subr
 
For this routine, I do not have any custom error handling.

Error Tracking is set to "Break on Unhandled Errors"

Again, I get no indication that there has been an error, no msg box with the
run time error number etc. The procedure simply stops and does not execute
the next statement.


"Tim Williams" wrote:

Do you have any error handling in your routine?
What setting do you have in the VBE under Tools Options General Error
tracking ?

Tim



"mrbarritt" wrote in message
...
Chip,
There are two cases for code initiation. One is a button control that I
have placed on a sheet, the other is a custom menu that I have added to
the
menu bar. In either case the execution does not involve a worksheet cell.

Mark

"Chip Pearson" wrote:

Are these lines of code being executed in a VBA procedure that is
directly or indirectly called from a worksheet cell? If so, that is
the problem. Code initiated by a worksheet cell cannot make any
changes to the Excel environment.

Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)



On Wed, 2 Sep 2009 16:54:19 -0700, rarity
wrote:

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 a

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?







All times are GMT +1. The time now is 04:51 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com