Macro to make excel close

G

grandfilth

I'm making a program in excel, and have been trying to create a macr
that makes excel close, without the "do you want to save" pop-up comin
up, alas i have failed, does anyone have any ideas?i've trie
activewindow.close..
 
Z

Zack Barresse

Excel close? Or just the open file?

... will close the active workbook ..

sub closebooknow()
if activeworkbook is nothing then exit sub
activeworkbook.close false
end sub

... will close excel ..

sub closeappnow()
application.displayalerts = false
application.quit
end sub

HTH
 
G

Guest

You can use
Activeworkbook.Saved = True
to tell excel that the current file is already saved and no further action
is required.

Application.quit
will close down Excel
 
R

Ron de Bruin

Hi grandfilth

You can have more then one workbook open in Excel.
What you do then ?

Try this

ActiveWorkbook.Close False ' or true if you want to save
Application.Quit
 
G

Guest

hi,
ActiveWindow.save
ActiveWindow.close

this will prevent the save as box from popping up.

FSt1
 

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