ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   WriteResPassword (https://www.excelbanter.com/excel-programming/430839-writerespassword.html)

Graham35p

WriteResPassword
 
Hi
I have a button on my spreadsheet to copy the sheet to our network.
I want the network version to be view only i.e. password protected to stop
anyone writing / changing it.
I have put a password in the WriteResPassword section of the Save As block.
This works fine if the file doesn't already exist on the network but if the
file exists already it won't give me the option to overwrite it.(it will if I
have the WriteResPassword ="")
I get a 'do you want to save changes to workbook 2' message.
Any help would be appreciated.
Many thanks


Gord Dibben

WriteResPassword
 

Have you tried wrapping your save as code in displayalerts?

Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:= _
"C:\program files\microsoft office\exceldata\aaaaa.xls",
FileFormat:= _
xlNormal, Password:="qwert", WriteResPassword:="asdfg", _
ReadOnlyRecommended:=False, CreateBackup:=False
Application.DisplayAlerts = True


Gord Dibben MS Excel MVP

On Wed, 08 Jul 2009 11:41:48 GMT, "Graham35p" <u53127@uwe wrote:

Hi
I have a button on my spreadsheet to copy the sheet to our network.
I want the network version to be view only i.e. password protected to stop
anyone writing / changing it.
I have put a password in the WriteResPassword section of the Save As block.
This works fine if the file doesn't already exist on the network but if the
file exists already it won't give me the option to overwrite it.(it will if I
have the WriteResPassword ="")
I get a 'do you want to save changes to workbook 2' message.
Any help would be appreciated.
Many thanks



Graham35p via OfficeKB.com

WriteResPassword
 

Hi Gord
Thanks for the reply
I tried your suggestion.
It worked once then I tried it again after making a change to the data. The
screen flashed briefly as if something was happening but the file didn't
update.
I tried it with a different spreadsheet and got the same result. Worked once
only.
I have tried closing the sheet and opening it again and various other things
but can't get it to work again.
Very strange.

Graham


Gord Dibben wrote:
Have you tried wrapping your save as code in displayalerts?

Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:= _
"C:\program files\microsoft office\exceldata\aaaaa.xls",
FileFormat:= _
xlNormal, Password:="qwert", WriteResPassword:="asdfg", _
ReadOnlyRecommended:=False, CreateBackup:=False
Application.DisplayAlerts = True

Gord Dibben MS Excel MVP

Hi
I have a button on my spreadsheet to copy the sheet to our network.

[quoted text clipped - 7 lines]
Any help would be appreciated.
Many thanks


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200907/1


Gord Dibben

WriteResPassword
 
Strange indeed.

Tested several times with changes made each time and had no problem with the
code saving changes and overwriting with no alert.

I am not part of a network so can't test that aspect regarding permissions.


Gord

On Thu, 09 Jul 2009 07:22:24 GMT, "Graham35p via OfficeKB.com" <u53127@uwe
wrote:

Hi Gord
Thanks for the reply
I tried your suggestion.
It worked once then I tried it again after making a change to the data. The
screen flashed briefly as if something was happening but the file didn't
update.
I tried it with a different spreadsheet and got the same result. Worked once
only.
I have tried closing the sheet and opening it again and various other things
but can't get it to work again.
Very strange.

Graham


Gord Dibben wrote:
Have you tried wrapping your save as code in displayalerts?

Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:= _
"C:\program files\microsoft office\exceldata\aaaaa.xls",
FileFormat:= _
xlNormal, Password:="qwert", WriteResPassword:="asdfg", _
ReadOnlyRecommended:=False, CreateBackup:=False
Application.DisplayAlerts = True

Gord Dibben MS Excel MVP

Hi
I have a button on my spreadsheet to copy the sheet to our network.

[quoted text clipped - 7 lines]
Any help would be appreciated.
Many thanks



Graham35p via OfficeKB.com

WriteResPassword
 

If it works for you then maybe it's something to do with our network set up.
I'm off for 2 weeks now but will do some more testing when I get back and let
you know the results if I find a cure.

Thanks for your help.
much appreciated.

Graham

Gord Dibben wrote:
Strange indeed.

Tested several times with changes made each time and had no problem with the
code saving changes and overwriting with no alert.

I am not part of a network so can't test that aspect regarding permissions.

Gord

Hi Gord
Thanks for the reply

[quoted text clipped - 27 lines]
Any help would be appreciated.
Many thanks


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/200907/1



All times are GMT +1. The time now is 05:18 PM.

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