File Attributes / Save As New File Name

  • Thread starter Thread starter Paul Moles
  • Start date Start date
P

Paul Moles

Having reset a worksheet to zero, how can I force users to
use a new filename, rather than just Save and defaulting
to existing name.

Can I set Read Only attribute for currently open file or
alternatively bring up File Save As and only accept new
name entries?

Many Thanks

Paul
 
Paul Moles said:
Having reset a worksheet to zero, how can I force users to
use a new filename, rather than just Save and defaulting
to existing name.

Can I set Read Only attribute for currently open file or
alternatively bring up File Save As and only accept new
name entries?

Many Thanks

Paul

Hi Paul:

You can set the starting file to read only just by going into Windows
Explorer ... right click on the file name ... properties ... tick read only.

Alternatively, you can do it in VBA:
SetAttr "C:\MyFile.xls", vbReadOnly

BUT you can't do that for a file that is already open!

What you can also do is ask the user for the file name (either by inputting
it on the spreadsheet or through an input box). You can then check whether
the file already exists before saving by using

While Dir ("C:\MyChosenFileName") <> ""
Code to ask user to choose a different file name
Wend
 
Back
Top