Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Suggested answer

How to Save a Excel file with Password in NAV (Through Codeunit).?

(0) ShareShare
ReportReport
Posted on by 245

Hello Experts,

Actually I Wrote code to unprotect the Excel file to perform operations on that file , the code is as Like below 

ExcelApplicationClass_l := ExcelApplicationClass_l.ApplicationClass;

ExcelWorkbook_l := ExcelApplicationClass_l.Workbooks.Open(FileNameP,0,FALSE,5,'4540','',TRUE,1,'Chr(9)',TRUE,FALSE,0,TRUE,1,0);

ExcelWorkbook_l.Unprotect('4540');

ExcelWorkbook_l.SaveAs(FileNameP,ExcelXLFileFormat_l.xlOpenXMLWorkbook,'','',FALSE,FALSE,ExcelXLSaveAsAccessMode_l.xlNoChange,ExcelXLSaveConflictResoultion_l.xlUserResolution,FALSE,'','',TRUE);

ExcelWorkbook_l.Close(FALSE,FileNameP,FALSE);

ExcelApplicationClass_l.Quit;

By using this code my Excel file is saving without Password , but I need to Save file with password after performing operations on that Excel file.

Can any one Suggest me how can I save Excel file with Password.

Thank you.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to Save a Excel file with Password in NAV (Through Codeunit).?

    I am here with a blog that will tell users how to restore password-protected Excel files. So just go with the blog and learn different methods to remove Password from Excel 2016. If you will perform manual method then keep a backup of your data. And even expert method is also given to perform recovery of excel password.

  • Suggested answer
    himanshi Profile Picture
    himanshi 5 on at
    RE: How to Save a Excel file with Password in NAV (Through Codeunit).?

    The effective solution to retrieve the lost password instantly is by utilizing Excel password recovery Software by perfect data solution that have excellent features to recover forgotten excel passwords from MS Excel2016 and 2013, 2010 Password, 2007, 2003, 2002(XP), 2000 and Excel 97 It can Unlock any Strong Password combination from simple to complex, whether it is, Alphabetic, Numeric, Alphanumeric, Printable character, and, User-Defined Character. This Software also recover to set the password minimum & maximum value of the recovering of Excel file password and also provides demo facility to recover password of first three characters of show the password. (Users can also, try its FREE DEMO VERSION)

    RED MORE- www.perfectdatasolutions.com/excel-password-recovery-software.html

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,711 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,458 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans