+ Reply to Thread
Results 1 to 6 of 6

Save Template as Macro-Enabled

  1. #1
    Registered User
    Join Date
    03-13-2017
    Location
    Virginia
    MS-Off Ver
    2013
    Posts
    34

    Save Template as Macro-Enabled

    Hello,

    I am working with a file that is a macro-enabled template. I would like to request help with a macro that will do three things:
    1. Save the template as a macro-enabled file.
    2. Take the user to the Save As window of the directory F:\Billing Department\Share\Invoices\Setup\Commercial Customers. The user can then chose to save the file here or to any other subfolder from there.
    3. Have as default “Setup Sheet” in the “File name” field of the Save As window. The user can then modify the field by adding any other text.

    I would to attach this macro to a button.

    I hope I explained this clearly enough. Thank you for any help!

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Save Template as Macro-Enabled

    Hi Rosie,

    I'm not sure you want to do this. It sounds too much like the Minerva Word virus. In Word, when you opened a document a macro would run that saved itself (Minerva that is) to the default template. You simply needed to open a word file that had it in it and if you then sent any word files to others, they to caught this virus. Minerva spread lie wildfire across the net. To keep this from happening again, we now have to accept Excel and Word files that have macros in them with a prompt.

    What are you trying to accomplish with your problem?
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    03-13-2017
    Location
    Virginia
    MS-Off Ver
    2013
    Posts
    34

    Re: Save Template as Macro-Enabled

    Hi Marvin,

    Thank you for the reply and for pointing this out to me.

    The purpose of the macro is to make sure that when the user saves the template (.xltm), it is saved as a macro-enabled document as opposed to an .xls document. This way, when the user goes to modify the document again, they will still have other macros in the document available to them to use. Does this answer the question? I'm sorry, I perhaps should have explained this earlier.

  4. #4
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Save Template as Macro-Enabled

    Hi Rosie,

    Nothing pops into my head on how to accomplish what I think you want. It seems to me you can't save a macro file as an .xlsx as Excel gives this a warning. Perhaps this link will help?
    https://www.lifewire.com/xltm-file-2622543

    Another concern I have is that the "template" file or "default" settings file has moved around in newer versions of Excel. The answer might depend on which version of Excel the user is using. Read:
    http://www.meadinkent.co.uk/xlconfigure.htm

  5. #5
    Registered User
    Join Date
    03-13-2017
    Location
    Virginia
    MS-Off Ver
    2013
    Posts
    34

    Re: Save Template as Macro-Enabled

    Thank you, Marvin.

    Just to clarify, I am looking for a macro that will save an .xltm file as an .xlsm (not .xlsx). I don't know that this changes your answer, but I just wanted to make sure we were on the same page.

    I will glean through the links you provided. Thanks for researching and sending them on to me!

  6. #6
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,167

    Re: Save Template as Macro-Enabled

    Hi Rosie,

    Here is a page that walks you through the vba that does what I think you want.
    http://www.rondebruin.nl/win/s5/win001.htm

+ 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. Odd behaviour when using a macro enabled template
    By MrBaseline in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-20-2015, 06:00 PM
  2. VBA BeforeSave can't save in Macro Enabled Template
    By lucidlil in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-02-2015, 11:15 AM
  3. Help with Macro enabled Template
    By stuartgb100 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-21-2015, 02:30 AM
  4. HELP!! Can not run macro from a workbook created from a macro enabled template.
    By wacky_diva in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-08-2014, 01:10 AM
  5. Auto new folder and file from a macro enabled template
    By brisket in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-22-2014, 12:52 AM
  6. [SOLVED] Why not always save a template file in the Macro-Enabled format?
    By alice2011 in forum Excel General
    Replies: 2
    Last Post: 01-17-2014, 06:15 AM
  7. Save a Macro Enabled Template to a custom location with a custom file name.
    By andcha in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 06-24-2013, 11:46 AM

Tags for this Thread

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