ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Closing a workbook (https://www.excelbanter.com/excel-programming/287993-closing-workbook.html)

Belinda

Closing a workbook
 
Hello All

I have built a application in Excel which uses multiple workbooks when
I press a button I jump from one workbook to another.

To exit a workbook I used the following Activeworkbook.close but
everytime I do this I get a message to save or discard the changes
from Excel. All these workbooks are reports and no changes are made
whatsoever.

Can you kindly provide a workaround how I can close the workbook
programatically without encountering this save or discard message.

Many thanks
Belinda

Chip Pearson

Closing a workbook
 
Belinda,

Try something like

ActiveWorkbook.Close savechanges:=False


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


"Belinda" wrote in message
om...
Hello All

I have built a application in Excel which uses multiple

workbooks when
I press a button I jump from one workbook to another.

To exit a workbook I used the following Activeworkbook.close

but
everytime I do this I get a message to save or discard the

changes
from Excel. All these workbooks are reports and no changes are

made
whatsoever.

Can you kindly provide a workaround how I can close the

workbook
programatically without encountering this save or discard

message.

Many thanks
Belinda




Nikos Yannacopoulos[_5_]

Closing a workbook
 
Belinda,

Just add one little word!

Activeworkbook.Close False

HTH,
Nikos

"Belinda" wrote in message
om...
Hello All

I have built a application in Excel which uses multiple workbooks when
I press a button I jump from one workbook to another.

To exit a workbook I used the following Activeworkbook.close but
everytime I do this I get a message to save or discard the changes
from Excel. All these workbooks are reports and no changes are made
whatsoever.

Can you kindly provide a workaround how I can close the workbook
programatically without encountering this save or discard message.

Many thanks
Belinda





All times are GMT +1. The time now is 04:11 PM.

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