how to disable save prompt on closing excel file in automated mode

G

Guest

how to disable "Do you want to save the changes to <file name>" manual prompt
everytime while closing excel files having macros (macro password not known),
while in automated task mode which is closing and opening files automatically.
 
D

Dave Peterson

If I want to close another workbook in VBA, I'd use something like:

workbooks("otherworkbook.xls").close savechanges:=false

(false means I want to discard those changes.)
 
G

Guest

Hello Dave,
Thanks for your reply. Pls. help me understand what u meant to say,

My problem is I have approx. 6000 excel files and these files go as input to
a software program which automatically picks data from these files by openng
and closing them on its own. But since these files contain macros so
everytime a self opened file is closing down it asks for a manual
intervention to save changes or not... which defies the whole purpose of
automation. Iam a very basic user of excel and so would like to know how can
I avert that prompt so that the whole process runs smoothly.

Thanks and regards,
Vipul Agarwal
 
D

Dave Peterson

I have no idea what language your automated routine is in. So I responded with
what I would do if I opened a workbook in Excel's VBA.

The savechanges:=false portion tells excel to close the workbook without
saving--even if changes have been made.
 

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