+ Reply to Thread
Results 1 to 6 of 6

ActiveWorkbook.Close function

  1. #1
    Dan
    Guest

    ActiveWorkbook.Close function

    Is there a way to prefill in the "File Name:" in the Save As window when
    using the ActiveWorkbook.Close function?

    I want to prefill the filed with the name of the file opened with

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

    Want the workbook name to be the same name as that opened by DataFileName
    (less the .txt or .asc extension) and not "Sheet1".

    Thanks

  2. #2
    News
    Guest

    Re: ActiveWorkbook.Close function

    Just do a
    WB.SaveAs NameYouWant.xls,xlWorkbookNormal
    then when you close, the SaveAs dialog will not show.

    NickHK

    "Dan" <Dan@discussions.microsoft.com> 级糶秎ン穝籇:F60B0A42-0F37-48CF-8D39-CE054135C00F@microsoft.com...
    > Is there a way to prefill in the "File Name:" in the Save As window when
    > using the ActiveWorkbook.Close function?
    >
    > I want to prefill the filed with the name of the file opened with
    >
    > DataFileName = Application.GetOpenFilename(filefilter:="Text or ASC Files,
    > *.txt; *.asc", Title:="Select the Data File")
    >
    > Want the workbook name to be the same name as that opened by DataFileName
    > (less the .txt or .asc extension) and not "Sheet1".
    >
    > Thanks




  3. #3
    Dan
    Guest

    Re: ActiveWorkbook.Close function

    I want to still prompt them on saving but I wanted to prefill in the name of
    the file into the File Name field of the Save As window.


    "News" wrote:

    > Just do a
    > WB.SaveAs NameYouWant.xls,xlWorkbookNormal
    > then when you close, the SaveAs dialog will not show.
    >
    > NickHK
    >
    > "Dan" <Dan@discussions.microsoft.com> 录露录g漏贸露l楼贸路s禄D:F60B0A42-0F37-48CF-8D39-CE054135C00F@microsoft.com...
    > > Is there a way to prefill in the "File Name:" in the Save As window when
    > > using the ActiveWorkbook.Close function?
    > >
    > > I want to prefill the filed with the name of the file opened with
    > >
    > > DataFileName = Application.GetOpenFilename(filefilter:="Text or ASC Files,
    > > *.txt; *.asc", Title:="Select the Data File")
    > >
    > > Want the workbook name to be the same name as that opened by DataFileName
    > > (less the .txt or .asc extension) and not "Sheet1".
    > >
    > > Thanks

    >
    >
    >


  4. #4
    News
    Guest

    Re: ActiveWorkbook.Close function

    Use .GetsaveAsFilename and set the first argument, InitialFilename.

    NickHk

    "Dan" <Dan@discussions.microsoft.com> 级糶秎ン穝籇:4F5FF989-07E6-4D96-806E-CCE36BF12F54@microsoft.com...
    >I want to still prompt them on saving but I wanted to prefill in the name
    >of
    > the file into the File Name field of the Save As window.
    >
    >
    > "News" wrote:
    >
    >> Just do a
    >> WB.SaveAs NameYouWant.xls,xlWorkbookNormal
    >> then when you close, the SaveAs dialog will not show.
    >>
    >> NickHK
    >>
    >> "Dan" <Dan@discussions.microsoft.com> ???gco?los?D:F60B0A42-0F37-48CF-8D39-CE054135C00F@microsoft.com...
    >>
    >> > Is there a way to prefill in the "File Name:" in the Save As window
    >> > when
    >> > using the ActiveWorkbook.Close function?
    >> >
    >> > I want to prefill the filed with the name of the file opened with
    >> >
    >> > DataFileName = Application.GetOpenFilename(filefilter:="Text or ASC
    >> > Files,
    >> > *.txt; *.asc", Title:="Select the Data File")
    >> >
    >> > Want the workbook name to be the same name as that opened by
    >> > DataFileName
    >> > (less the .txt or .asc extension) and not "Sheet1".
    >> >
    >> > Thanks

    >>
    >>
    >>




  5. #5
    Dan
    Guest

    Re: ActiveWorkbook.Close function

    Something is not working. Where do I set this statement?

    Also I want to keep the workbook open after saving the file.


    "News" wrote:

    > Use .GetsaveAsFilename and set the first argument, InitialFilename.
    >
    > NickHk
    >
    > "Dan" <Dan@discussions.microsoft.com> 录露录g漏贸露l楼贸路s禄D:4F5FF989-07E6-4D96-806E-CCE36BF12F54@microsoft.com...
    > >I want to still prompt them on saving but I wanted to prefill in the name
    > >of
    > > the file into the File Name field of the Save As window.
    > >
    > >
    > > "News" wrote:
    > >
    > >> Just do a
    > >> WB.SaveAs NameYouWant.xls,xlWorkbookNormal
    > >> then when you close, the SaveAs dialog will not show.
    > >>
    > >> NickHK
    > >>
    > >> "Dan" <Dan@discussions.microsoft.com> ???gco?l垄Do隆Ps?D:F60B0A42-0F37-48CF-8D39-CE054135C00F@microsoft.com...
    > >>
    > >> > Is there a way to prefill in the "File Name:" in the Save As window
    > >> > when
    > >> > using the ActiveWorkbook.Close function?
    > >> >
    > >> > I want to prefill the filed with the name of the file opened with
    > >> >
    > >> > DataFileName = Application.GetOpenFilename(filefilter:="Text or ASC
    > >> > Files,
    > >> > *.txt; *.asc", Title:="Select the Data File")
    > >> >
    > >> > Want the workbook name to be the same name as that opened by
    > >> > DataFileName
    > >> > (less the .txt or .asc extension) and not "Sheet1".
    > >> >
    > >> > Thanks
    > >>
    > >>
    > >>

    >
    >
    >


  6. #6
    NickHK
    Guest

    Re: ActiveWorkbook.Close function

    Before you wish to .SaveAs the file, the same as you are using the
    GetOpenFilename before you .Open the file initially.

    As for keeping the file open, don't .Close it then, although I thought was
    the whole point going by your subject line.

    NickHK

    "Dan" <Dan@discussions.microsoft.com> wrote in message
    news:DD9FBB0A-F802-47CD-A89E-B416D37A4C46@microsoft.com...
    > Something is not working. Where do I set this statement?
    >
    > Also I want to keep the workbook open after saving the file.
    >
    >
    > "News" wrote:
    >
    > > Use .GetsaveAsFilename and set the first argument, InitialFilename.
    > >
    > > NickHk
    > >
    > > "Dan" <Dan@discussions.microsoft.com>

    级糶秎ン穝籇:4F5FF989-07E6-4D96-806E-CCE36BF12F54@microsoft.com...
    > > >I want to still prompt them on saving but I wanted to prefill in the

    name
    > > >of
    > > > the file into the File Name field of the Save As window.
    > > >
    > > >
    > > > "News" wrote:
    > > >
    > > >> Just do a
    > > >> WB.SaveAs NameYouWant.xls,xlWorkbookNormal
    > > >> then when you close, the SaveAs dialog will not show.
    > > >>
    > > >> NickHK
    > > >>
    > > >> "Dan" <Dan@discussions.microsoft.com>

    ???gco?los?D:F60B0A42-0F37-48CF-8D39-CE054135C00F@microsoft.com...
    > > >>
    > > >> > Is there a way to prefill in the "File Name:" in the Save As window
    > > >> > when
    > > >> > using the ActiveWorkbook.Close function?
    > > >> >
    > > >> > I want to prefill the filed with the name of the file opened with
    > > >> >
    > > >> > DataFileName = Application.GetOpenFilename(filefilter:="Text or ASC
    > > >> > Files,
    > > >> > *.txt; *.asc", Title:="Select the Data File")
    > > >> >
    > > >> > Want the workbook name to be the same name as that opened by
    > > >> > DataFileName
    > > >> > (less the .txt or .asc extension) 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