Assigning Name to new workbook

G

Guest

Want to assign a name to a worksheet based on user input.

DataFileName = Application.GetOpenFilename(filefilter:="Text or ASC Files,
*.txt; *.asc", Title:="Select the Data File")

'Create A New WorkBook With One Worksheet
Workbooks.Add template:=xlWorksheet

Want the workbook name to be the same name as that opened by DataFileName
and not "Sheet1".

Thanks
 
B

Bob Phillips

Then you need to save it with that filename, the filename only gets assigned
on a save.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
B

Bob Phillips

Why would you use the SaveAs window? you have the filename so just save it
with that name.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 

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