(Solved) – VBA error 1004 occurs when accessing Names within events

  • by

I cannot set (or read) a name in event-driven procedures. This line of code fails only when within an event, with

error 1004 “application-defined or object-defined error”.

Names("infoLastSheet").Value = "TOC"

“InfoLastSheet” has Workbook scope.

Leave a Reply

Your email address will not be published. Required fields are marked *