Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting a filename in Excel

Status
Not open for further replies.

dzshanno

IS-IT--Management
Aug 24, 2001
13
0
0
GB
Is there a way that I can force the filename for a workbook?

I want a user to open a template file. Fill in some details and save the file with its filname being based on a cell on the sheet

I could use

projectfilename = sheets("PEROJECT INFO").CELLS(5,5).value
saveas (projectfilename,xlnormal)

but where should I put it to ensure that it is fired correctly?

If I put it in beforeSave I get an infinite loop. If I set cancel = true It doesnt seem to save at all

any ideas?

Thanks in advance

David
 
remove the save and save as commands from your tool bar, then.

Put your code in the "on workbook close sub".
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top