+ Reply to Thread
Results 1 to 2 of 2

Create a new workbook with a new name and save to desktop

  1. #1
    Forum Contributor
    Join Date
    04-11-2012
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2010
    Posts
    245

    Create a new workbook with a new name and save to desktop

    Hello -

    I have a .xlsm workbook that I want to treat as a template. That is, I want to keep this workbook pristine so it can be accessed over and over again. I want it to function as follows:

    1) Whenever a user opens the workbook he/she will immediately be prompted to enter a new 'file name' (let's says this will be a group or organization name) via an inputbox.

    2) Upon clicking ok in the inputbox window, the workbook will be saved to the desktop as a separate file, with the 'new file name' and as the same file type (i.e., .xlsm).

    3) The original "template" workbook should be automatically closed.


    The problem I'm having is two-fold:

    Problem #1: When I run my macro it saves a file to my desktop but with the name...'FileName', not the name I input.

    Problem #2: I want this macro to be removed or disabled in the new workbook when it is created.

    Below is what I have so far. A sample of my workbook is also attached.

    Please Login or Register  to view this content.
    Attached Files Attached Files

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,721

    Re: Create a new workbook with a new name and save to desktop

    The simplest way to disarm this macro is to check to see if it is the original template file.

    The other problem you have is that you are using the string "FileName" instead of the variable FileName.

    Please Login or Register  to view this content.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/code]

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 7
    Last Post: 01-19-2017, 09:37 AM
  2. Save Range as New Workbook to Desktop
    By Kehoth01 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 12-03-2014, 10:34 AM
  3. [SOLVED] VBA: Create a new folder on any users desktop and save the file as value in cell (A51)
    By nwb in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-24-2014, 11:02 PM
  4. Macro to open embed excel workbook & save it on desktop
    By bonny24tycoon in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-02-2012, 12:12 PM
  5. cannot save a workbook to the desktop of any user
    By dschmitt in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-28-2011, 05:20 AM
  6. Save workbook to Desktop if file doesn't exists
    By realniceguy5000 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-22-2009, 01:22 PM
  7. Save Excel workbook to Desktop Using a Macro
    By Marvin in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-11-2006, 02:25 PM

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