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.
 
Back
Top