Change the code to the following and it will close the workbook and
eliminate the need to change the DisplayAlerts setting:
Workbooks("Employee DataBase.xls").Close False
--
Rob Bovey, Excel MVP
Application Professionals
http://www.appspro.com/
* Take your Excel development skills to the next level.
* Professional Excel Development
http://www.appspro.com/Books/Books.htm
"scrabtree23" <(E-Mail Removed)> wrote in message
news:574E2249-EB31-4951-8CB8-(E-Mail Removed)...
> In Excel 2003 I wrote a code that briefly turns off "Display Alerts"
>
> Application.DisplayAlerts = False
> Windows("Employee DataBase.xls").Close
> Application.DisplayAlerts = True
>
> The code goes to the "Employee Database" file and closes it (the file the
> code is in was pulling some data from that file.
>
> Now we have Vista and Exel 2007. The file the code lives in and the
> "Employee Database" file open and work properly in the new version of
> Excel
> except I get an error that freezes everything up at the code listed above.
>
> When I omit the "DisplayAlerts" code, everything works, but you have to
> answer the pop-up questions to close "Employee Database".
>
> How can I re-write this code?