Dim wkb As Workbook, wbkNew As Workbook
Application.EnableEvents = False
Application.ScreenUpdating = False
' Set wbDest = ThisWorkbook
'If WorkbookOpen("Payroll GL Summary.xls") Then
' Workbooks("Payroll GL Summary.xls").Close
'Workbooks.Close Filename:="C:\GL Summary\Payroll GL Summary.xls", savechanges:=False
Set wbkNew = Workbooks.Add
wbkNew.SaveAs Filename:="Payroll GL Summary"
Application.EnableEvents = True
Application.ScreenUpdating = True
I have been breaking my head with the above code for a while now.
I want to close a work book if its open 'Payroll GL Summary.xls'
Then overwrite the existing file (this portion is buggy at the bottom part of above code)
I am really confused about how to check if a workbook is open and then closing it!
Any help is much appreciated!