Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

excel macro write reserve

Status
Not open for further replies.

paulcedarhill

Technical User
Mar 22, 2004
46
US
I am a novice programmer trying to write a macro to save a write protected fil. The macro is activiated through a control box, after the file has been opened with read/write priviledge. I get an error saying file is write reserved. Here is tha code for the save, that was recorded through keystrokes in macor record. What am I missing?

ActiveWorkbook.SaveAs Filename:="T:\Production Logs\06 prod log.xls", _
FileFormat:=xlNormal, Password:="", WriteResPassword:="STARS", _
ReadOnlyRecommended:=False, CreateBackup:=False
 
Are you opening the file via code? If so, could you post this. The only way I can trigger the error you report is if the file is saved with a Write Reservation password but opened Read Only prior to running your SaveAs code.


Regards,
Mike
 
No I am opening it manually with the password necessary for write priveledges. There may be another network user with the file open in read only mode. I just now thought of that but it does not effect the operator generated attempt at saving the file.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top