Ark68
Well-known Member
- Joined
- Mar 23, 2004
- Messages
- 4,564
- Office Version
- 365
- 2016
- Platform
- Windows
I have an application in one workbook (wb1) that draws on data in another workbook (wb2). I have to open wb2 to access it. wb2 has a workbook open event, and when wb1 opens wb2, this code is executed and causes all kinds of issues.
Is there a way that I can disable the workbook open event when wb1 opens it?
I had thought of putting some bypass flay in the wb2 open code to skip the procedure:
eg.
Then in wb1, before opening wb2 adding this...
But this won't work will it? I can't carry variable between two workbooks can I?
Is there a way that I can disable the workbook open event when wb1 opens it?
I had thought of putting some bypass flay in the wb2 open code to skip the procedure:
eg.
VBA Code:
Private Sub Workbook_Open() 'in wb2 - data source
If ref2 = "wb1" Then Exit Sub 'if this workbook was opened by wb1 then bypass this workbook open code
End sub
VBA Code:
ref2 = "wb1"