Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default 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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 22,906
Default 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


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default 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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
WriteResPassword... Sam Excel Programming 0 April 28th 09 05:27 PM
Setting Password & WriteResPassword Kevin H. Stecyk[_2_] Excel Programming 0 January 27th 05 02:16 AM


All times are GMT +1. The time now is 11:27 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"