Workbook_BeforeSave ActiveWorkbook.Name Error

S

sermest

Hi,

I am trying to setup the file name as below using specific ranges

I wrote below code to Workbook_BeforeSave()

With Worksheets("Vendor")
FName = .Range("F5").Value
ActiveWorkbook.Name = FName & Format(Date, "ddmmyy") & ".xls"
End With

When I click save as I receive below error:
"Can't assign to read-only property"

Please help
 
G

Guest

Name is a read only property. You could use save as in it's place but you can
not change the name of the open file. The same as in a spreadsheet you can
not change the name of the open file. Only save it under a different name.
 

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