It is the very first thing you must check before doing anything else. If the corresponding Workbook is unavailable or not selected when compiling the VBA script ...
Can you post the section of code that's generating the error? Off the top of my head, it looks like you are going out of bounds with an array, but it's not really possible to say until we see what's ...