![]() |
Close a the current workbook and load another specified workbook
Hi,
How do we code in VBA to close the current workbook and load another specifed one? For example, I am currently in ABC.xls and I wish to close this workbook and load DEF.xls.... -- Regards, Adrian |
Close a the current workbook and load another specified workbook
Activeworkbook.Close Workbooks.Open filename:="C:\myDir\DEF.xls" -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Adrian" wrote in message ... Hi, How do we code in VBA to close the current workbook and load another specifed one? For example, I am currently in ABC.xls and I wish to close this workbook and load DEF.xls.... -- Regards, Adrian |
Close a the current workbook and load another specified workbook
Bob Phillips wrote
Activeworkbook.Close Workbooks.Open filename:="C:\myDir\DEF.xls" Will the second line really execute if the calling file is closed? -- David |
Close a the current workbook and load another specified workbook
Adrian,
Try something like Sub AAA() Workbooks.Open "DEF.xls" Workbooks("ABC.xls").Close savechanges:=True End Sub -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Adrian" wrote in message ... Hi, How do we code in VBA to close the current workbook and load another specifed one? For example, I am currently in ABC.xls and I wish to close this workbook and load DEF.xls.... -- Regards, Adrian |
All times are GMT +1. The time now is 08:26 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com