+ Reply to Thread
Results 1 to 5 of 5

Renaming Active.Workbook and saving it without saving Macro

  1. #1
    Registered User
    Join Date
    01-03-2012
    Location
    San Francisco
    MS-Off Ver
    Excel 2007
    Posts
    3

    Renaming Active.Workbook and saving it without saving Macro

    Hi everyone,

    This is my first post so please bear with me. I have a workbook that I input data into daily. The workbook "Perform NARS Projection.xlsm" manipulates the data. After I have inputed all the new daily data and my information is updated, I need to save the Active Workbook in my G drive.

    Ex: G:\Decision_Support\Doug\NARS\

    And I want to save it under the new name NARS Projection 2.0 (mm-dd-yy) with current date WITHOUT the last sheet (which has my macro instructions as well as WITHOUT the workbooks macros.

    Currently, I have this code which just saves the workbook under a new name in the necessary file but it saves the last worksheet as well as the macros. I tried changing xlsm to xlsx but it wouldn't allow me (and I have to save it as xlsx).

    Please Login or Register  to view this content.
    Is there a code I can use to eliminate the last Worksheet and the macros while still saving this to my G drive under the specified name?

    Thank you for the help!

  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: Renaming Active.Workbook and saving it without saving Macro

    You need to save it as an xlsx format, this won't save the macros.

    Please Login or Register  to view this content.
    Hope that helps.

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

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    01-03-2012
    Location
    San Francisco
    MS-Off Ver
    Excel 2007
    Posts
    3

    Re: Renaming Active.Workbook and saving it without saving Macro

    I have tried saving it as xlsx. However, an error message comes up each time and says that it won't allow it. The message says:

    Run-time error '1004':
    This extension can not be used with the selected file type. Change the file extension in the File name text box or select a different file type by changing the Save As type.

    What does this mean? If I need a different code to do what I initially wanted in my intial post, what do I have to change?

    Thank you

  4. #4
    Forum Expert shg's Avatar
    Join Date
    06-20-2007
    Location
    The Great State of Texas
    MS-Off Ver
    2003, 2010
    Posts
    40,678

    Re: Renaming Active.Workbook and saving it without saving Macro

    I think Roy just misplaced an argument:

    Please Login or Register  to view this content.
    BTW, I would encode date as yyyy-mmdd so it sorts naturally in Explorer.
    Entia non sunt multiplicanda sine necessitate

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

    Re: Renaming Active.Workbook and saving it without saving Macro

    Thanks Shg, it was late last night - I missed the + sign after :

+ 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