WorkbookClose_ANmar

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

WkNa, Optional SaveitifClosing

WorkbookClose_ANmar "Data.xlsx", 1

Views 309 Downloads 128

'FindFile', 'workbook', 'close', 'save', 'instance', 'WorkbookOpen_ANmar', 'WorkbookOpenAsk_ANmar'

ANmarAmdeen
324
Components VBA-Excel
Revisions

v2.0

Needs