Hi All,
I want to create excel file which user can't edit.
Also user not able to copy the contents of generated file.
Is it possible in c#.net windows application
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Rajeesh MenothRank #118 · 18.4K reputationPosted Feb 6, 2016, 3:23 AM EST
Abhay ShankerRank #375 · 6.7K reputationPosted Feb 6, 2016, 7:33 AM EST
Alex SmithRank #4,089 · 366 reputationPosted Mar 14, 2016, 1:28 AM EDT
using Spire.Xls;
namespace lock_excel_worksheet
{
{
static void Main(string[] args)
{
Workbook workbook = new Workbook();
workbook.LoadFromFile(@"..\lock worksheet.xls");
workbook.Worksheets[0].Range.Style.Locked = true;
workbook.Worksheets[1].Range.Style.Locked = true;
workbook.SaveToFile("result.xls");
}
}
}
Jignesh KumarRank #91 · 22.9K reputationPosted Nov 19, 2018, 5:20 PM EST