Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Please can somebody help with the code to close all open workbooks without
referring to them by name. I often have to open about 30 workbooks and closing them down is a waste of time. Also, I use Excel 2007 but the workbooks are mostly in Excel 2003. I need all the workbooks saved but without the Check Compatibility checked. Please help |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I do not have 2007 here to test my code on but here is something that should
be close.. sub CloseBooks() dim wbk as workbook for each wbk in workbooks wbk.close SaveChanges:=true next wbk exit sub -- HTH... Jim Thomlinson "MurrayB" wrote: Please can somebody help with the code to close all open workbooks without referring to them by name. I often have to open about 30 workbooks and closing them down is a waste of time. Also, I use Excel 2007 but the workbooks are mostly in Excel 2003. I need all the workbooks saved but without the Check Compatibility checked. Please help |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Jim
I tried the code but it only closes my Personal Macro Workbook. I need to keep that sheet open but close all my "data" workbooks. Any ideas? Thanks Murray "Jim Thomlinson" wrote in message ... I do not have 2007 here to test my code on but here is something that should be close.. sub CloseBooks() dim wbk as workbook for each wbk in workbooks wbk.close SaveChanges:=true next wbk exit sub -- HTH... Jim Thomlinson "MurrayB" wrote: Please can somebody help with the code to close all open workbooks without referring to them by name. I often have to open about 30 workbooks and closing them down is a waste of time. Also, I use Excel 2007 but the workbooks are mostly in Excel 2003. I need all the workbooks saved but without the Check Compatibility checked. Please help |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Sep 16, 3:22*pm, "MurrayB" wrote:
Please can somebody help with the code to close all open workbooks without referring to them by name. I often have to open about 30 workbooks and closing them down is a waste of time. Also, I use Excel 2007 but the workbooks are mostly in Excel 2003. I need all the workbooks saved but without the Check Compatibility checked. Please help MurrayB- The Close All command is still available in Excel 2007 and can be added to the QAT. It will prompt you to save all workbooks that have been updated. However, there is no real easy way to avoid the compatability checker. For workbooks I use frequently, I uncheck the option so that it doesn't keep popping up on every save. I am unaware of any global setting. Therefore, it appears it's a one-time uncheck for each workbook. Regards, Excel.Instructor (Ed2Go.com/Advanced Excel) |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub CLOSE_ALL()
Application.ScreenUpdating = False Application.DisplayAlerts = False For Each w In Application.Workbooks w.Save w.Close SaveChanges:=True Next w 'uncomment line below to automatically leave 'Application.Quit End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software "MurrayB" wrote in message ... Please can somebody help with the code to close all open workbooks without referring to them by name. I often have to open about 30 workbooks and closing them down is a waste of time. Also, I use Excel 2007 but the workbooks are mostly in Excel 2003. I need all the workbooks saved but without the Check Compatibility checked. Please help |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Don
I tried the code but it only closes my Personal Macro Workbook. I need to keep that workbook open but close all my "data" workbooks. Any ideas? Thanks Murray "Don Guillett" wrote in message ... Sub CLOSE_ALL() Application.ScreenUpdating = False Application.DisplayAlerts = False For Each w In Application.Workbooks w.Save w.Close SaveChanges:=True Next w 'uncomment line below to automatically leave 'Application.Quit End Sub -- Don Guillett Microsoft MVP Excel SalesAid Software "MurrayB" wrote in message ... Please can somebody help with the code to close all open workbooks without referring to them by name. I often have to open about 30 workbooks and closing them down is a waste of time. Also, I use Excel 2007 but the workbooks are mostly in Excel 2003. I need all the workbooks saved but without the Check Compatibility checked. Please help |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
close all open workbooks except the active one | Excel Programming | |||
VBA Code req to close all workbooks | Excel Programming | |||
VBA Code req to close all workbooks | Excel Programming | |||
Open Close workbooks | Excel Discussion (Misc queries) | |||
help with macro to open and close workbooks | Excel Programming |