ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   closing active windows without saving changes (https://www.excelbanter.com/excel-programming/326229-closing-active-windows-without-saving-changes.html)

Tony

closing active windows without saving changes
 
Hi,
Im working with Excel 2003. This line is supposed to allow
me to close an active window without being asked to save
any changes:

ActiveWindow.Close SaveChanges:=wdDoNotSaveChange

It does not work. Any ideas on what does work?

Also, how can I prvent the message about saving the
clipboard from being displayed?


Dave Peterson[_5_]

closing active windows without saving changes
 
It looks like you're mixing excel and word.

If you want to close a workbook, you could use:

activeworkbook.close savechanges:=false

And
application.cutcopymode = false

should stop the clipboard message.

Tony wrote:

Hi,
Im working with Excel 2003. This line is supposed to allow
me to close an active window without being asked to save
any changes:

ActiveWindow.Close SaveChanges:=wdDoNotSaveChange

It does not work. Any ideas on what does work?

Also, how can I prvent the message about saving the
clipboard from being displayed?


--

Dave Peterson

Trevor Shuttleworth

closing active windows without saving changes
 
Tony

if, by closing the Active Window, you want to close the Active Workbook, try
something like:

Workbooks("BOOK1.XLS").Close SaveChanges:=False

Check the VBA Help.

Regards

Trevor


"Tony" wrote in message
...
Hi,
Im working with Excel 2003. This line is supposed to allow
me to close an active window without being asked to save
any changes:

ActiveWindow.Close SaveChanges:=wdDoNotSaveChange

It does not work. Any ideas on what does work?

Also, how can I prvent the message about saving the
clipboard from being displayed?





All times are GMT +1. The time now is 11:01 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com