Microsoft Office Excel provides a few layers of security and protection that allow you to control the access to an Excel document. VSTO offers a much wider variety of data and content protection options. One of the important concepts is authentication via a password request in order to access the data in the workbook. However, there are no out-of-the-box options available in VSTO to validate the strength of the password assigned to the workbook or worksheet.
The best way of protecting an Excel document is to protect your entire Excel file with an access password, which will allow only authorized users to view or modify the data inside the workbook.
Password
is a property of the Excel workbook class. You can access this property via the Globals.ThisWorkbook.Password
property. You have more options available for password encryption when developing a protected Excel solution. Let's take a look at an example.
Open Visual Studio 2008 and create a new...