lock for editing

D

des-sa

please could someone help.
i have a macro which uses certain cell entries in a sheet in my workbook to
save the excel file as "psmith-chevrolet-quotenr1234-150109" for easy
identification afterwards. is it possible to add vb script that would lock
the file for editing after it has been saved the first time? the file is a
quote which is given to customers, and i want to prohibit employees from
altering another employee's quote afterwards. futhermore, is it possible to
incorporate password protection for editing?

thanks
 
D

des-sa

thanks for reply. it would most certainly, but there are 5 interconnected
sheet, i.e. each file comprize: sheet 1= the quote, sheet 2 = the job card
(generated from the info in the quote) etc. so i need the file to keep it's
format as an excel file.
thanks
 
G

Gord Dibben

ActiveWorkbook.SaveAs Filename:= _
"C:\yourpath\yourname" & ".xls", FileFormat:=xlNormal _
, Password:="", WriteResPassword:="yourpword", _
ReadOnlyRecommended:=True

Note: user can always save as not read-only under a new name then delete
your copy and re-name theirs as original after making changes.


Gord Dibben MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top