dpaton05
Well-known Member
- Joined
- Aug 14, 2018
- Messages
- 2,352
- Office Version
- 365
- 2016
- Platform
- Windows
I have a workbook that calls a procedure when it opens.
If it is not open, I want to open it. If it doesn't exist I want to create it. What is the code for that?
VBA Code:
Private Sub Workbook_Open()
Call CheckYPFileOpen
End Sub
VBA Code:
Sub CheckYPFileOpen()
If Not isFileOpen("YPNames.xlsm") Then Workbooks.Open ThisWorkbook.Path & "\" & "Young People" & "\" & "YPNames.xlsm"
End Sub
If it is not open, I want to open it. If it doesn't exist I want to create it. What is the code for that?