View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
JM[_5_] JM[_5_] is offline
external usenet poster
 
Posts: 11
Default 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