closing a workbook with a macro

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"???
 
D

Dave Peterson

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"???
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top