Results 1 to 2 of 2

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

Threaded View

  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.

    Private Sub Workbook_Open()
    
    Dim FileName As String
    FileName = InputBox("What is the name of this group or event?")
     
        ChDir "C:\Users\Tom\Desktop"
        ActiveWorkbook.SaveAs FileName:="C:\Users\Tom\Desktop\FileName.xlsm", _
            FileFormat:=xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
    End Sub
    Attached Files Attached Files

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