Skip to main content

Notifications

Announcements

No record found.

Dynamics 365 Community / Forums / Finance forum / How to protect excel s...
Finance forum
Unanswered

How to protect excel sheet in d365fo

Posted on by 25
Hello.

I asked 2 questions, but I didn't get the answer I wanted, so I'm writing.

I want to do 'excel sheet protection' when I make excel file in d365fo, but I only got indirect answers.

I want a direct code that does excel sheet protection.

Thank you for reading the question
  • Martin Dráb Profile Picture
    Martin Dráb 228,971 Most Valuable Professional on at
    How to protect excel sheet in d365fo
    Good! I'm glad you found in the end that the approach I suggested indeed solves the problem.
     
    For reference, the discussion is split to three threads with the same name. If anyone is interested in details, please refer to them.
    js lee, please use replies next times, instead of creating several new threads on the same topic.
  • js lee Profile Picture
    js lee 25 on at
    How to protect excel sheet in d365fo
    After many attempts, we succeeded as follows
     
     
       ExcelSheetProtection   _Protection =  worksheet.protection;
       _Protection.isProtected = true;
       _Protection.SetPassword("123");
      package.Save();

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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,665 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,971 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,150

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans