Hello,
I write some VBA code for my personal use. I think when the code depends on retrieving information from an existing object, e.g. a specific cell value from a worksheet from a workbook, and the value or object is not valid then VBA fails. In my case, for example, my macros fail if I have another workbook already open because I look for specific worksheets from a workbook.
You can prevent the error by catching the error if the worksheet does not exist or doesn't contain the information.
Regards,
Leila