closing a workbook with a macro

  • Thread starter Thread starter Fan924
  • Start date Start date
F

Fan924

From a Macro, I have

Set wb1 = ActiveWorkbook
On Error Resume Next
Set wb2 = Workbooks("library.xls")
If wb2 Is Nothing Then
Set wb2 = Workbooks.Open("c:\My Documents\_MapForm\library.xls")
End If

before exiting the macro, is there a way I can close the workbook
"library.xls"???
 
wb2.close savechanges:=false 'or true


From a Macro, I have

Set wb1 = ActiveWorkbook
On Error Resume Next
Set wb2 = Workbooks("library.xls")
If wb2 Is Nothing Then
Set wb2 = Workbooks.Open("c:\My Documents\_MapForm\library.xls")
End If

before exiting the macro, is there a way I can close the workbook
"library.xls"???
 
Back
Top