Help with quiting a workbook

T

Tempy

Hi All, i have a problem in trying to close my workbook with code. My
workbook is called "Recon_Master.xls. I use the following code:
Workbooks("Recon_Master.XLS").Close SaveChanges:=False

It works, but leaves like an excel "shell" and i need it all to close ?
I have used application.quit as well but if the user has another
workbook open it closes that as well and i had a very irate user on my
hands !!


Tempy

*** Sent via Developersdex http://www.developersdex.com ***
 
R

Rob Docherty

application.workbooks.count

Will tell you how many workbooks are open, if this is 0 then you can call
the quit code.

Hope this helps,

Rob
 

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