ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Password protected workbook (https://www.excelbanter.com/excel-programming/422790-password-protected-workbook.html)

Kell2604

Password protected workbook
 
In a macro I have it opens a workbook that is password protected. I would
like the macro to accept the Read Only option, without me having to actually
click on the prompt. Is this possible?

The DisplayAlert command doesn't seem to work (unless I'm using it wrong).

Thanks very much as always!!
Kelley

Per Jessen

Password protected workbook
 
Hi
Open the workbook as ReadOnly by default:

Workbooks.Open Filename:="MyFile.xls", ReadOnly:=True

Hopes this helps.

---
Per

"Kell2604" skrev i meddelelsen
...
In a macro I have it opens a workbook that is password protected. I would
like the macro to accept the Read Only option, without me having to
actually
click on the prompt. Is this possible?

The DisplayAlert command doesn't seem to work (unless I'm using it wrong).

Thanks very much as always!!
Kelley



Halim

Password protected workbook
 
Hi Kell,
Maybe you can try this one:
Sub TestReadonly()
Application.DisplayAlerts = False
Workbook.open "C:\Yourbook.xls"
end sub

--
Regards,

Halim



"Kell2604" wrote:

In a macro I have it opens a workbook that is password protected. I would
like the macro to accept the Read Only option, without me having to actually
click on the prompt. Is this possible?

The DisplayAlert command doesn't seem to work (unless I'm using it wrong).

Thanks very much as always!!
Kelley



All times are GMT +1. The time now is 12:40 AM.

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