File Attributes / Save As New File Name

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
 
G

GB

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
 

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