+ Reply to Thread
Results 1 to 4 of 4

Assigning Name to new workbook

  1. #1
    Dan
    Guest

    Assigning Name to new workbook

    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

  2. #2
    Bob Phillips
    Guest

    Re: Assigning Name to new workbook

    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)

    "Dan" <[email protected]> wrote in message
    news:[email protected]...
    > 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




  3. #3
    Dan
    Guest

    Re: Assigning Name to new workbook

    Is there a way to prefill in the "File Name:" in the Save As window?


    "Bob Phillips" wrote:

    > 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)
    >
    > "Dan" <[email protected]> wrote in message
    > news:[email protected]...
    > > 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

    >
    >
    >


  4. #4
    Bob Phillips
    Guest

    Re: Assigning Name to new workbook

    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)

    "Dan" <[email protected]> wrote in message
    news:[email protected]...
    > Is there a way to prefill in the "File Name:" in the Save As window?
    >
    >
    > "Bob Phillips" wrote:
    >
    > > 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)
    > >
    > > "Dan" <[email protected]> wrote in message
    > > news:[email protected]...
    > > > 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

    > >
    > >
    > >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1