I have an application that consists of a workbook, call it Event for want of another name, that contains a reference to two other workbooks. One of these is nothing but code, nothing in it is ever changed, and the other is a list of names. The application is designed to accommodate any number of concurrently open Event workbooks.
Sometimes, not all the time but more often than not, when the first Event workbook is opened, which in turn opens the code and names workbooks via its references, this Event workbook either appears not to trigger the Workbook_Open event at all [as determined by the failure of a Debug.Print line in the Workbook_Open event] or, if it does trigger this event, it fails in a subsequent line of code "current_sheet = ActiveSheet.name". It's the 'Activesheet.name' that fails, not the assignment as determined by invoking the 'debug' option on the error dialog and doing "?current_sheet = ActiveSheet.name" in the immediate window.
If this first Event workbook is closed leaving the code and names workbooks still open, and then re-opened or other Event worksheets are subsequently opened, they all execute flawlessly.
This is driving me crazy. Is there some obscure timing race? Is the code work book sufficiently large to load in a timely manner? It's about 1.2Mb but even this size seems to vary based on principles unclear to me. What?
Whatever it is, it's most annoying and I would appreciate any insight anyone might have as to just what is happening here.
Sometimes, not all the time but more often than not, when the first Event workbook is opened, which in turn opens the code and names workbooks via its references, this Event workbook either appears not to trigger the Workbook_Open event at all [as determined by the failure of a Debug.Print line in the Workbook_Open event] or, if it does trigger this event, it fails in a subsequent line of code "current_sheet = ActiveSheet.name". It's the 'Activesheet.name' that fails, not the assignment as determined by invoking the 'debug' option on the error dialog and doing "?current_sheet = ActiveSheet.name" in the immediate window.
If this first Event workbook is closed leaving the code and names workbooks still open, and then re-opened or other Event worksheets are subsequently opened, they all execute flawlessly.
This is driving me crazy. Is there some obscure timing race? Is the code work book sufficiently large to load in a timely manner? It's about 1.2Mb but even this size seems to vary based on principles unclear to me. What?
Whatever it is, it's most annoying and I would appreciate any insight anyone might have as to just what is happening here.