Check if Excel file is password protected

  • Thread starter Christopher J Tallos
  • Start date
C

Christopher J Tallos

The follwing code throws up a prompt for a password when the Excel file is
password protected (it is vb.net).

ExcelWorkBook = ExcelApplication.Workbooks.Open(ExcelFullName, Nothingobj,
True, Nothingobj, Nothingobj, Nothingobj, Nothingobj, Nothingobj,
Nothingobj, Nothingobj, Nothingobj, Nothingobj, Nothingobj, Nothingobj,
Nothingobj)

How do I detect in code (vb.net or c#) if an Excel workbook is password
protected when I get the prompt for password at the same time I am trying to
open it?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top