+ Reply to Thread
Results 1 to 3 of 3

set filename to <filename-date> on open

  1. #1
    bob engler
    Guest

    set filename to <filename-date> on open

    I would like to have the filename of a excel WB set to
    <filename-currentdate> on open the original file so when
    the people save it, it will save it to the new name. ie:

    open MGA (template file) and make the active WB
    MGA-071106 which is a copy of MGA.xls. That way when
    the people click Save, it will save it to the new file (they
    have problems following simple instructions.

    Thanks...



  2. #2
    Hayeso
    Guest

    RE: set filename to <filename-date> on open

    Press Alt+F11 to go to the Microsoft Visual Basic Editor
    Press CTRL+R to View the Project Explorer
    Expand the MGA.xls Project and doubleclick the ThisWorkBook Object
    Paste in the following code

    Private Sub Workbook_Open()
    With Me
    .SaveAs .Path & "\MGA-" & Format(Now, "mmddyy") & ".xls"
    End With
    End Sub

    Save and close your workbook



    "bob engler" wrote:

    > I would like to have the filename of a excel WB set to
    > <filename-currentdate> on open the original file so when
    > the people save it, it will save it to the new name. ie:
    >
    > open MGA (template file) and make the active WB
    > MGA-071106 which is a copy of MGA.xls. That way when
    > the people click Save, it will save it to the new file (they
    > have problems following simple instructions.
    >
    > Thanks...
    >
    >
    >


  3. #3
    bob engler
    Guest

    Re: set filename to <filename-date> on open

    Thanks, is there a way to replace the "\MGA" with the filename of the
    opened
    template file? I have different ones, MGA, RVA etc. Also, how do I set
    the new file not to run the macro? I only want the people to have the macro
    run from the template file. If they reopen a saved file, I want it to stay
    as
    that filename.





    "Hayeso" <[email protected]> wrote in message
    news:[email protected]...
    > Press Alt+F11 to go to the Microsoft Visual Basic Editor
    > Press CTRL+R to View the Project Explorer
    > Expand the MGA.xls Project and doubleclick the ThisWorkBook Object
    > Paste in the following code
    >
    > Private Sub Workbook_Open()
    > With Me
    > .SaveAs .Path & "\MGA-" & Format(Now, "mmddyy") & ".xls"
    > End With
    > End Sub
    >
    > Save and close your workbook
    >
    >
    >
    > "bob engler" wrote:
    >
    > > I would like to have the filename of a excel WB set to
    > > <filename-currentdate> on open the original file so when
    > > the people save it, it will save it to the new name. ie:
    > >
    > > open MGA (template file) and make the active WB
    > > MGA-071106 which is a copy of MGA.xls. That way when
    > > the people click Save, it will save it to the new file (they
    > > have problems following simple instructions.
    > >
    > > 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