Closes a workbook, checks if it is already open first, works for workbooks within same instance
Function WorkbookClose_ANmar(WkNa, Optional SaveitifClosing = 0)
' needs FindFile
If FindFile(WkNa) Then
SaSa = False
If SaveitifClosing = 1 Then SaSa = True
Workbooks(WkNa).Close SaSa
End If
End Function
' needs FindFile
If FindFile(WkNa) Then
SaSa = False
If SaveitifClosing = 1 Then SaSa = True
Workbooks(WkNa).Close SaSa
End If
End Function
WkNa, Optional SaveitifClosing
WorkbookClose_ANmar "Data.xlsx", 1
Views 4,299
Downloads 1,324
CodeID
DB ID