ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to password protect an 2007 workbook without show readonly opt (https://www.excelbanter.com/excel-programming/432180-how-password-protect-2007-workbook-without-show-readonly-opt.html)

Yazeed

How to password protect an 2007 workbook without show readonly opt
 
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

Ron de Bruin

How to password protect an 2007 workbook without show readonly opt
 
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

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm




"Yazeed" wrote in message ...
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


Yazeed

How to password protect an 2007 workbook without show readonly
 
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.

"Ron de Bruin" wrote:

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

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm




"Yazeed" wrote in message ...
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



Ron de Bruin

How to password protect an 2007 workbook without show readonly
 
Oops you posted in programming

I have no problem when I use this

ActiveWorkbook.SaveAs Filename:="test.xlsx", FileFormat:=51, Password:="123"

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm




"Yazeed" wrote in message ...
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.

"Ron de Bruin" wrote:

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

--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm




"Yazeed" wrote in message ...
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




All times are GMT +1. The time now is 11:19 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com