User chooses a folder. Code operates on workbooks
in that folder in sequence, first doing some calculations,
then running a protection routine, before moving on to
the next workbook.
I wish to save these files (with changes) back to the
original folder ( and overwrite), and also to a new folder
with a new filename. However, I also need to keep the
file open (with the original filename).
With all files being saved to the "C" drive, and with the
changed files open (with original filenames),
Here's what I have:
'to save with new filename to new folder:
ChDir NextVlnDir
ActiveWorkbook.Protect
ActiveWorkbook.SaveAs FileName:=NameOfFile
'result: correctly saves new filename to new folder
but no protection
Where is my error, please?
Regards.
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (
http://www.grisoft.com).
Version: 6.0.614 / Virus Database: 393 - Release Date: 05/03/2004