I am using Excel 2010 and I am using java excel connector library (from http://www.moyosoft.com ) to open, read/write and close excel files.
I do not want to see any alerts while closing the workbook if it is not saved so I am using setDisplayAlerts to False.
But it is not working in Excel 2010. In Excel 2007, it used to work fine.
I searched on internet and came across this link and it says to set property AskToUpdateLinks to false. I did that also but i still get a pop up while closing the workbook.
Any ideas what I am missing and how can it be resolved?
Rgds,
Sapan
Just before closing the workbook call this:
workbook.saved = truewhere workbook is the workbook you are closing.This will tell Excel you actually did save the workbook (even though you didn’t), and therefore will avoid the alert.
Edit: I just checked the documentation on what you are using. Try
workbook.setSaved(true)which probably does what I indicated (the documentation doesn’t indicate what that method does).