Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / New Users / September 2004

Tip: Looking for answers? Try searching our database.

Setting Macro to save write-restricted workbook

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kate - 14 Sep 2004 13:23 GMT
Hello,

I have a macro that is built to 1)update a report daily,
then 2)save it to two different locations (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
- 15 Sep 2004 17:51 GMT
hi,
you already have the code.
in the activeWorkbook.saveas part Password:=""
put your password between the double quotes.
Password:="yourpassword"
:)
>-----Original Message-----
[quoted text clipped - 29 lines]
>
>.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.