Hello Experts
I am writing code for unprotecting Excel file & Saving that file using saveas function. as like below
Variables
Name DataType Subtype Length
ExcelApplicationClass_l DotNet Microsoft.Office.Interop.Excel.ApplicationClass.'Microsoft.Office.Interop.Excel, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c'
ExcelWorkbook_l DotNet Microsoft.Office.Interop.Excel.Workbook.'Microsoft.Office.Interop.Excel, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c'
ExcelXLFileFormat_l DotNet Microsoft.Office.Interop.Excel.XlFileFormat.'Microsoft.Office.Interop.Excel, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c'
ExcelXLPlatform_l DotNet Microsoft.Office.Interop.Excel.XlPlatform.'Microsoft.Office.Interop.Excel, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c'
ExcelXLSaveAsAccessMode_l DotNet Microsoft.Office.Interop.Excel.XlSaveAsAccessMode.'Microsoft.Office.Interop.Excel, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c'
ExcelXLSaveConflictResoultion_l DotNet Microsoft.Office.Interop.Excel.XlSaveConflictResolution.'Microsoft.Office.Interop.Excel, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c'
While Running the above code , confirmation message is showing as like below
But I don't want to display Confirmation message , Can any one suggest me how can I modify my code to avoid confirmation message while saving file.Because I need to run this codeunit from Job Queue.
Thank you.
On the ExcelApplication class, there is a property called DisplayAlerts set that to false
ExcelApplicationClass_1.DisplayAlerts(FALSE);
Hello,
This confirmation message if thrown by Xlworkbook DotNet DLL
Solution 1 would be to play arround with the saveas function parameters (specialy the XlSaveAsAccessMode)
Solution 2 would be to simply erase or move the destination file before the saveas execution(xlworkbook still handling the file content in memory)
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156