+ Reply to Thread
Results 1 to 8 of 8

Workbooks copy help

  1. #1
    Registered User
    Join Date
    01-12-2012
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2007
    Posts
    6

    Workbooks copy help

    So I have a tricky problem I believe. I am looking to make a copy of a workbook that is a weekly log of activities for a systems group. At the end of the week I would like to have the users click a button and have a new copy of the workbook created omitting any information that was entered for the week. In addition I would like it to save the new workbook with the next weeks date on the end of the name of the file.

    To boot all the sheets are password protected, the workbook is restricted for editing and then the workbook is shared.

    Any thoughts?

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Workbooks copy help

    The best way would be to create a template file
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Expert Whizbang's Avatar
    Join Date
    08-05-2009
    Location
    Greenville, NH
    MS-Off Ver
    2010
    Posts
    1,395

    Re: Workbooks copy help

    Create a template file (meaning no data, just formats and formulas and protection). Then add this code to a module:

    Please Login or Register  to view this content.

    Then tie this macro to a button or shortkey or something and have your users run it at the appropriate time.

  4. #4
    Registered User
    Join Date
    01-12-2012
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Workbooks copy help

    So this seems to be working somewhat. It doesn't seem to save the new workbook in the directory I am specifying and thus isn't giving the new file the date on the end. Any thoughts? When I click the button it is just bringing up the template file only in a new workbook but not renaming or saving.

  5. #5
    Registered User
    Join Date
    01-12-2012
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Workbooks copy help

    Check that. Seems to be working once I had the proper security settings to write to the destination drive.

  6. #6
    Forum Expert Whizbang's Avatar
    Join Date
    08-05-2009
    Location
    Greenville, NH
    MS-Off Ver
    2010
    Posts
    1,395

    Re: Workbooks copy help

    Make sure you have the trailing backslash in the TemplateFilePath. Also, try adding the .xlsm to the DestinationFileName

  7. #7
    Registered User
    Join Date
    01-12-2012
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Workbooks copy help

    Here is another question based on the same file. If I wanted to save the file as instructed with the date at the end but also change the names of the sheets within the workbook to reflect the days of the upcoming week is that possible? I am thinking no or at least not without great difficulty.

    Thanks!

  8. #8
    Forum Expert Whizbang's Avatar
    Join Date
    08-05-2009
    Location
    Greenville, NH
    MS-Off Ver
    2010
    Posts
    1,395

    Re: Workbooks copy help

    There are probably better ways to do this, but here is what I came up with in a couple of minutes:

    Please Login or Register  to view this content.

+ 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