Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Need to set up Macro to save/replace existing doc with password

Hello,

I have a macro that is built to 1)update a report daily,
then 2)save it to two different files (into two
workbooks). I need both to be password protected to
modify. The end of the macro looks something like this:

ChDir "G:\WIL"
ActiveWorkbook.SaveAs Filename:= _
"G:\WIL\Wrkbk.xls", _
FileFormat:=xlNormal, Password:="",
WriteResPassword:="orange", _
ReadOnlyRecommended:=False, CreateBackup:=True
ChDir "G:\FRE"
ActiveWorkbook.SaveAs Filename:= _
"G:\FRE\Wrkbk.xls" _
, FileFormat:=xlNormal, Password:="",
WriteResPassword:="orange", _
ReadOnlyRecommended:=False, CreateBackup:=True

However, I get a debug error that says: "Operation
failed. 'G:\WIL\Wrkbk.xls' is write reserved.', because
the previous file that is being replaced is write
protected, and I don't want it to be removed.

Is there a code I can use to automatically enter the
password to modify, then replace? Thanks for the help.

Kate
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
save password using macro linda Excel Discussion (Misc queries) 1 September 27th 07 09:58 AM
save as macro/for password Dedrie Excel Worksheet Functions 0 August 22nd 05 03:21 PM
Applying Existing Password to New Spreadsheet Vic Excel Discussion (Misc queries) 1 January 27th 05 12:37 AM
How do you replace an existing file, saying "yes" in a macro? Chris Excel Programming 0 November 19th 03 03:25 PM
Automatically replace existing file on save ronber[_2_] Excel Programming 1 September 25th 03 10:05 PM


All times are GMT +1. The time now is 10:49 PM.

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

About Us

"It's about Microsoft Excel"