ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Respond to a Display Alert (https://www.excelbanter.com/excel-programming/430230-respond-display-alert.html)

Dave

Respond to a Display Alert
 

I have a file that is protected with a password required to modify. When my
macro goes to open the file I receive a dispaly alert that it is recommended
that the file is opened read only with three options to choose from; yes, no,
cancel. Yes is the default but I want the macro to select NO. How can I do
this? Please see the line of code below

Workbooks.Open Filename:=MyFile, WriteResPassword:=My_PW
--
Thank you

Dave

michdenis

Respond to a Display Alert
 

Hi Dave,

Have you tried this ?

Workbooks.Open Filename:=MyFile, ReadOnly:=Yes, WriteResPassword:=My_PW




"Dave" a écrit dans le message de groupe de discussion :
...
I have a file that is protected with a password required to modify. When my
macro goes to open the file I receive a dispaly alert that it is recommended
that the file is opened read only with three options to choose from; yes, no,
cancel. Yes is the default but I want the macro to select NO. How can I do
this? Please see the line of code below

Workbooks.Open Filename:=MyFile, WriteResPassword:=My_PW
--
Thank you

Dave


Dave

Respond to a Display Alert
 

thanks, I used this to work

Workbooks.Open Filename:=MyFile, IgnoreReadOnlyRecommended:=True,
WriteResPassword:=My_PW

--
Thank you

Dave


"MichDenis" wrote:

Hi Dave,

Have you tried this ?

Workbooks.Open Filename:=MyFile, ReadOnly:=Yes, WriteResPassword:=My_PW




"Dave" a écrit dans le message de groupe de discussion :
...
I have a file that is protected with a password required to modify. When my
macro goes to open the file I receive a dispaly alert that it is recommended
that the file is opened read only with three options to choose from; yes, no,
cancel. Yes is the default but I want the macro to select NO. How can I do
this? Please see the line of code below

Workbooks.Open Filename:=MyFile, WriteResPassword:=My_PW
--
Thank you

Dave




All times are GMT +1. The time now is 01:50 AM.

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