How to password protect an 2007 workbook without show readonly opt

  • Thread starter Thread starter Yazeed
  • Start date Start date
Y

Yazeed

Hi All,

I'm trying to set a password on a workbook using PIAs 2007, the problem is
when opening that workbook, a promot opens asking for a password and a
readonly button, i want to get rid of that readonly button and just protect
the workbook from opening without a password?



Thanks in advance
 
Hi Yazeed

If you set the protection you have a option to use read only or not

Use only the password to open in the dialog and it will work like you want
 
Hi Ron,

Thank for you input, even though its not working, here is a code snippet:

Workbook.SaveAs("test.xlsx", , Type.Missing, "123", false, false,
Type.Missing, XlSaveAsAccessMode.xlNoChange, Type.Missing, Type.Missing,
Type.Missing, Type.Missing, Type.Missing);

This will save the workbook with a password, but when you open the workbook
manually(not through the code) the promot appears to enter the password along
with that READONLY button.
 

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

Back
Top