Macro to automatically sellect 'No' in dialog box

A

ARbitOUR

Hi all!

I'm busy creating a macro to automatically update certain values, text
and cell formats etc. once it is run. The workbook to be updated, as
well as the workbook containing the update values are both password
protected. Both workbooks are saved with the option enabled to recommend
read-only upon opening them upon which the end-user has the option of
selection either 'Yes' or 'No' . I need an entry in my macro that will
automatically select the 'No' option, thereby opening the workbook in an
editable state.

Any help will be appreciated!
 
D

Dave Peterson

There are a couple of passwords (to open and to update) that could be
specified. But the parm you're looking for is "ignorereadonlyrecommended"

Dim wkbk as workbook

set wkbk = Workbooks.Open Filename:="C:\book1.xls", Password:="a", _
writerespassword:="b", ignorereadonlyrecommended:=True

I bet you're not using the writerespassword. So delete that.
 
A

ARbitOUR

Thx for the reply!

Unfortunately the link you have forwarded only provides code to open
the workbook in a 'read-only' state. I actually wish to do the opposite:
The default action for the workbook is to prompt the user (Y/N)
regarding read-only when he opens the workbook. However, the 'Automatic
update' macro I'm trying to create should automatically open the
workbook in its non-default state (i.e. a read-write state). In other
words, when the user manually opens the workbook it will provide the
read only prompt, but when the workbook is opened using this 'Update'
macro (situated in a different workbook), the workbook to be updated
must open in the read-write state.

Any help would be helpful!
(cliche...lol)
 

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