WriteResPassword

G

Graham35p

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
 
G

Gord Dibben

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
 
G

Graham35p via OfficeKB.com

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 said:
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
 
G

Gord Dibben

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
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 said:
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
 
G

Graham35p via OfficeKB.com

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 said:
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]
 

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