Password protected workbook

K

Kell2604

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
 
P

Per Jessen

Hi
Open the workbook as ReadOnly by default:

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

Hopes this helps.
 
H

Halim

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

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