Sub AAA()
ActiveWorkbook.close savechanges:=true
Workbooks.Open Filename:="C:\whatever.xls"
End Sub
(if the code is in the workbook that gets closed, then as soon as you close the
workbook, the macro will stop--so it won't open the "whatever.xls" workbook.)
One way around that is to open the new workbook and then close the other
workbook with the code in it.
Sub AAA()
Workbooks.Open Filename:="C:\whatever.xls"
ThisWorkbook.close savechanges:=true
End Sub
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.