View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Gord Dibben Gord Dibben is offline
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