ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   ClearContents in event proc raises error (https://www.excelbanter.com/excel-programming/303063-clearcontents-event-proc-raises-error.html)

JM[_5_]

ClearContents in event proc raises error
 
When I manipulate some data on worksheet X with a button fired macro, the
change event procedure of forms combobox on another worksheet (that refers
to data on worksheet X via a range name) fires that has the following code:

ThisWorkbook.Sheets("Mapping").Range("subd").Clear Contents

This code is raising an error, 1004 "ClearContents method of the Range class
failed". The range spec is correct, this code runs fine and as expected
when the combo is changed.

Why won't the above code run when the event is triggered by another macro?

I have tried to set the EnableEvents property of the XLApp to false when
macro1 runs, but the event is still fired, and the error still occurs.

Any ideas?

Thanks! JDM




All times are GMT +1. The time now is 01:35 PM.

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