Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi! I have two workbooks open in the same application. I want to close one without saving it. I use this code but it still asks me if I want to save changes. <Code start ActiveWindow.ActivateNext ActiveWorkbook.Saved = False ActiveWorkbook.Close <End Code Can I use code that will close without saving and not ask if I want to save changes? Thanks!! -- Brian Matlack ------------------------------------------------------------------------ Brian Matlack's Profile: http://www.excelforum.com/member.php...fo&userid=3508 View this thread: http://www.excelforum.com/showthread...hreadid=510128 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
activeworkbook.Close savechanges:=False
-- When you lose your mind, you free your life. "Brian Matlack" wrote: Hi! I have two workbooks open in the same application. I want to close one without saving it. I use this code but it still asks me if I want to save changes. <Code start ActiveWindow.ActivateNext ActiveWorkbook.Saved = False ActiveWorkbook.Close <End Code Can I use code that will close without saving and not ask if I want to save changes? Thanks!! -- Brian Matlack ------------------------------------------------------------------------ Brian Matlack's Profile: http://www.excelforum.com/member.php...fo&userid=3508 View this thread: http://www.excelforum.com/showthread...hreadid=510128 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() ben Wrote: activeworkbook.Close savechanges:=False -- When you lose your mind, you free your life. "Brian Matlack" wrote: Hi! I have two workbooks open in the same application. I want to close one without saving it. I use this code but it still asks me if I want to save changes. <Code start ActiveWindow.ActivateNext ActiveWorkbook.Saved = False ActiveWorkbook.Close <End Code Can I use code that will close without saving and not ask if I want to save changes? Thanks!! -- Brian Matlack ------------------------------------------------------------------------ Brian Matlack's Profile: http://www.excelforum.com/member.php...fo&userid=3508 View this thread: http://www.excelforum.com/showthread...hreadid=510128 Thanks to all for the great help!! -- Brian Matlack ------------------------------------------------------------------------ Brian Matlack's Profile: http://www.excelforum.com/member.php...fo&userid=3508 View this thread: http://www.excelforum.com/showthread...hreadid=510128 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
ActiveWorkbook.Saved = False is telling Excel that the workbook is not saved,
and so it is prompting with the "do you want to save..." Try ActiveWorkbook.Saved = True; then you will tell Excel that it is already saved and so Excel will think it is ok to close without saving. -- - K Dales "Brian Matlack" wrote: Hi! I have two workbooks open in the same application. I want to close one without saving it. I use this code but it still asks me if I want to save changes. <Code start ActiveWindow.ActivateNext ActiveWorkbook.Saved = False ActiveWorkbook.Close <End Code Can I use code that will close without saving and not ask if I want to save changes? Thanks!! -- Brian Matlack ------------------------------------------------------------------------ Brian Matlack's Profile: http://www.excelforum.com/member.php...fo&userid=3508 View this thread: http://www.excelforum.com/showthread...hreadid=510128 |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Change the False to True on the Saved line. This tells Excel that there have
been no changes since the last save so that it will not prompt the user to save again. ActiveWorkbook.Saved = True -- HTH... Jim Thomlinson "Brian Matlack" wrote: Hi! I have two workbooks open in the same application. I want to close one without saving it. I use this code but it still asks me if I want to save changes. <Code start ActiveWindow.ActivateNext ActiveWorkbook.Saved = False ActiveWorkbook.Close <End Code Can I use code that will close without saving and not ask if I want to save changes? Thanks!! -- Brian Matlack ------------------------------------------------------------------------ Brian Matlack's Profile: http://www.excelforum.com/member.php...fo&userid=3508 View this thread: http://www.excelforum.com/showthread...hreadid=510128 |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
whateverworkbookyouwanttoclose.close savechanges:=false
Brian Matlack wrote: Hi! I have two workbooks open in the same application. I want to close one without saving it. I use this code but it still asks me if I want to save changes. <Code start ActiveWindow.ActivateNext ActiveWorkbook.Saved = False ActiveWorkbook.Close <End Code Can I use code that will close without saving and not ask if I want to save changes? Thanks!! -- Brian Matlack ------------------------------------------------------------------------ Brian Matlack's Profile: http://www.excelforum.com/member.php...fo&userid=3508 View this thread: http://www.excelforum.com/showthread...hreadid=510128 -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
close without saving | Excel Discussion (Misc queries) | |||
close w/o saving | Excel Worksheet Functions | |||
VBA - Close without saving changes | Excel Discussion (Misc queries) | |||
Close file without saving | Excel Programming | |||
Close without Saving In VBA | Excel Programming |