+ Reply to Thread
Results 1 to 4 of 4

VBA BeforeSave can't save in Macro Enabled Template

  1. #1
    Registered User
    Join Date
    07-23-2015
    Location
    U.S.A.
    MS-Off Ver
    2010
    Posts
    10

    VBA BeforeSave can't save in Macro Enabled Template

    Hi,
    I am an absolute beginner, Excel and VBA, but am great at ‘just in time’ learning. I’ve created a 2010 Macro Enabled Template with formulas and VBA code I found/adapted, shared so generously online. I am stuck at what is probably something so very basic but cannot find information on it after hours of searching.

    The VBA Code in ThisWorkbook, Private Sub Workbook Open and Private Sub Workbook BeforeClose, both work wonderfully. I am trying to add Private Sub Workbook BeforeSave code that I found, between the two other Subs, which forces the user to save the new document created as a Macro Enabled Workbook with today’s date (user will manually append the rest of the name with the relevant information).

    But, when I try to re-save the Template with the BeforeSave code in the Macro Enabled Template format, it only offers me the Macro Enabled Workbook format – quite logical, of course!

    How do I bypass it the one time to save the new code into the Template format? Any explanation would be very much appreciated, thanks Lillian

  2. #2
    Registered User
    Join Date
    09-05-2014
    Location
    Montreal
    MS-Off Ver
    2007
    Posts
    22

    Re: VBA BeforeSave can't save in Macro Enabled Template

    you can probably use

    Please Login or Register  to view this content.
    note that the path includes the full path + the file name with the extension.
    Also, be sure to save the original .xlsm file before this command as it will overthrow the original file (and the changes in the VBA code).

    See here for reference:
    https://msdn.microsoft.com/en-us/lib.../ff841185.aspx
    Last edited by ggs22; 07-30-2015 at 01:43 PM.

  3. #3
    Registered User
    Join Date
    04-30-2015
    Location
    Oregon, USA
    MS-Off Ver
    2010
    Posts
    50

    Re: VBA BeforeSave can't save in Macro Enabled Template

    Can you post a sample workbook?
    Click "Go Advanced" and scroll down to select "Manage Attachments"
    From there click "Add Files" and upload a sample workbook
    be sure to remove sensitive information

  4. #4
    Registered User
    Join Date
    07-23-2015
    Location
    U.S.A.
    MS-Off Ver
    2010
    Posts
    10

    Re: VBA BeforeSave can't save in Macro Enabled Template

    Thank you, appreciate your help!

+ 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. Help with Macro enabled Template
    By stuartgb100 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-21-2015, 02:30 AM
  2. 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
  3. 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
  4. [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
  5. [SOLVED] BeforeSave .Save / .SaveAs events not triggering when triggered by macro
    By TC1980 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 11-25-2013, 11:59 AM
  6. 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
  7. Problem with Save & Close macro and beforeSave event
    By Danny_ in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-18-2013, 04:32 PM

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