ClearContents in event proc raises error

J

JM

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").ClearContents

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
 

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