Can I programmatically force saving an XLTM template to save as an XLSM file in Excel 2010 without defaulting all Excel file types?

I created an Excel template which includes VB and macros as an EXCEL.XLTM template file (I used a template file to keep users from overwriting the sample template file), but I have noticed that when users save the template, Excel 2010 defaults to saving
the new file as a XLSX file (removing all the macros).
I know you can set Excel 2010 to always save as a certain format, but I really would prefer not forcing all Excel files to be macro enabled for the user
Is there a way to default the Save type to XLSM for this template only?  Like some code that I could put in that when the users saves, it saves as a macro enabled XLSM type only for this template file?
My users aren't exactly Excel savvy, so I wanted to make it as simple as possible for them.
Thanks!
Alan Edwards

Hi Alan,
>> Is there a way to default the Save type to XLSM for this template only?  Like some code that I could put in that when the users saves, it saves as a macro enabled XLSM type only for this template file?
In my option, you could achieve this by adding Application.GetSaveAsFilename Method to the workbook BeforeSave event. Some key code like below:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Dim FileNameVal As String
If SaveAsUI Then
FileNameVal = Application.GetSaveAsFilename(, "Excel Macro-Enabled Workbook (*.xlsm), *.xlsm")
Cancel = True
If FileNameVal = "False" Then 'User pressed cancel
Exit Sub
End If
ThisWorkbook.SaveAs Filename:=FileNameVal & ".xlsm", FileFormat:=xlOpenXMLWorkbookMacroEnabled
Application.EnableEvents = True
End If
End Sub
But there is a limitation of this workaround, in this workaround, the save as will only support the macro enabled type, other save as types like "xlsx" will be ignored.​
For more information about Application.GetSaveAsFilename Method (Excel), you could turn to the link below:
#Application.GetSaveAsFilename Method (Excel)
https://msdn.microsoft.com/en-us/library/office/ff195734.aspx
Best Regards,
Edward
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click HERE to participate the survey.

Similar Messages

  • I installed WIN 7 and can't open many attachments.  Message says it is not a supported file type ?

    After I replaced WIN XP with WIN 7 many attachments won't open.   Message says Adobe Reader (using Adobe X) can't open "xxxxxxxxx.pps" because it is either not a supported file type or because the  file has been damaged (for example, it was sent as an e-mail attachment and wasn't correctly decoded)  This never happened with WIN XP.  Any suggestions  nykirk

    How are you trying to open them?
    I ask because a .pps is a Powerpoint slide show and Adobe REader only opens PDF's.
    So, are you double clicking on a file and REader is trying to open them or are you opening Reader then using File>Open and navigating to the file or something else. As many details as you can supply would be good.

  • Can no longer send pictures in text that I once did. "Unsupported file type"

    The other day my phone began saying I could not longer send pictures in MMS. Pictures I sent the previous week are now an unsupport file type.  They are .jpg and .pngs.  I have to take a screenshot of them all now, crop out the excess stuff, and then send them.

    Taking a screenshot or cropping will tell nothing  .mov or .wmv format for example looks the same, one is supported by Apple QuickTime the other with Microsoft Windows Media Player, it's all in the codec. What is the exact file type? Or in what format were they saved and with what?

  • Can InCopy CS5 save to a CS4 file type

    I'm managing an e-learning project that requires a group of writers to use InCopy.  Everyone including our client is using IC CS4 but one of my writers who has been unable to find anything other than the latest version.  If she uses the CS5 version is there a way to save as to a CS4 compatible file that I can send to the client?  I know, for example, that Flash CS4 can save to a CS3 file format.  Thanks.

    I agree with Bob. The ICML format itself (InCopy native format) is essentially the same in CS5 as it was in CS4. So InCopy CS4 can open ICML files created in InCopy CS5. And InDesign CS4 can place InCopy CS5 ICML files, as far as I can tell. But it's *always* better to use the same version of ID and IC.
    One thing to keep in mind is that in InCopy CS5, the default font on both platforms is Minion Pro, not Times. This means the definition of the [Basic Paragraph] style is different. So if you're using styles, I would stay away from using any of the basic styles (including Table/Cell), and make sure your custom styles aren't based on them either.
    AM

  • Can't set plugins (like Quicktime, to be run in FF) for certain file types

    When I go to the application tab in options, I don't have the option to select a plugin for certain files - I'm trying to get Quicktime to open mp3s in Firefox, I know it can, it use to do that on my old computer, but Firefox doesn't give me the option - I see it listed for other files, but it doesn't appear for this one.
    == This happened ==
    Every time Firefox opened

    Still more data. iTunes on the Vista machine will still not allow me to change the location of the iTunes Folder with the Browse button. It acts like the network doesn't exist.
    But, surprisingly, if I go to File-Add File to Library, the network appears! Even stranger, File-Add Folder to Library, the network does NOT appear.
    Again, the network is clearly operationaly, and iTunes can even see the network in the Add File menu, but refuses to see it in the Advanced menu or Add Folder.
    It's not that Apple doesn't want me to be able to do this, because all of my XP machines running 7.6 do this flawlessly. There is clearly some bug between 7.6 and Vista.
    Rummaging around the forums convinces me that this is a pretty common problem, but I haven't found an answer yet.
    Thanks for any help,
    Shawn M.

  • How can I import my aol favorite places/bookmarks to Firefox using the pfc file type?

    I copied the favorites file from my aol account to a flash drive. However when I try to import to Firefox it only looks for html files.

    You will need to concert the pfc file to HTML format, you can do that by using this site - http://www.linkagogo.net/go/Convert?informat=aol&outformat=netscape

  • How can I take a photo on my iPhone then save it into a second Album, not Camera Roll?

    How can I take a photo on my iPhone then save it into a second Album, not Camera Roll?

    All photos captured or saved with the iPhone are stored in the Camera Roll which cannot be changed.
    You can create an album to place photos in that are in the Camera Roll which does not duplicate the photo. It creates a pointer to the original photo stored in the Camera Roll. If the original is deleted from the Camera Roll, it will be removed from the album as well.
    Import the photos from the Camera Roll with your computer as with any other digital camera followed by deleting the photos from the Camera Roll after the import process is complete. Create an album or albums for the imported photos on your computer followed by transferring the albums from your computer via the iTunes sync process which is selected under the Photos tab for your iPhone sync preferences with iTunes.

  • No .file type when saving???....

    hello has anyone had any issues with d/l themes? when I go to d/l I have nothing in the save as box just the name I created for the theme? there is no .file!!!!  

    There's no way to save themes as any . file type. You can just add the theme to swatches panel using 'Add to Swatches' option.

  • How can I recover a numbers spreadsheet.  When I saved as a template, my original file was replaced with the saved version.

    I save a numbers spreadsheet as a template and I lost my original document.  How can I recover the original spreadsheet?

    If the file you saved as a template no longer contains any data then I have no more suggestions other than restoring a backup copy.
    Have you looked for the original file? did you use spotlight?

  • How can I force Safari v.6.1 to Save passwords for sites that request passwords NOT BE Saved"?

    Since the last OS X update when Safari was updated to version 6.1, I am having problems with passwords not being saved from  specific sites that request that passwords "not be saved".
    Example: Adobe.com
    I did not have problem with Safari 5.1.
    When I go to Safari Preferences and "click on box" "Allow Autofill even for websites that request passwords not be saved", a pop up box opens and refers me to "SECURITY & PRIVACY" indicating that a "SCREENLOCK" must be engged to allow for this action.
    I have my firewall on.
    I don't understand what they are requesring me to lock & how to do it.
    Anyone who understands what I am being asked to do -or- how I can re-enable password saving, please email me.
    Thanks,
    <Email Edited by Host>

    Actually, Linc's reply is EXACTLY the answer that is required. 
    If you go to the setting he mentions and enable the password after screen saver or sleep, then Safari 6.1 will allow you to save all the autofill login information you like, even the stuff for sites that request not to save them.

  • Can no longer select text in email template or read only field with mouse using IE or Firefox?

    Hi Guys,
    I can no longer select text in email template or read only field using my mouse in IE or Firefox anymore. We are using CRM 2011 rollup 18 applied with IE 11 and the latest version of Firefox. We only applied roll up 18 in Feb when this issue began.
    Thanks
    Dave
    David Kelly

    When you have a problem with one particular site, a good "first thing to try" is clearing your Firefox cache and deleting your saved cookies for the site.
    (1) Bypass Firefox's Cache
    Use Ctrl+Shift+r to reload the page fresh from the server.
    (You also can clear Firefox's cache completely using:
    orange Firefox button ''or'' Tools menu > Options > Advanced
    On the Network mini-tab > Cached Web Content : "Clear Now")
    (2) Remove the site's cookies (save any pending work first) using either of these. While viewing a page on the site:
    * right-click and choose View Page Info > Security > "View Cookies"
    * Alt+t (open the classic Tools menu) > Page Info > Security > "View Cookies"
    Then try reloading the page. Does that help?
    These features rely on JavaScript, and it sounds as though you have scripting enabled if you get (the wrong) color changes. Some add-ons might alter the way scripts operate, so a standard diagnostic to bypass interference by extensions (and some custom settings) is to try Firefox's Safe Mode.
    First, I recommend backing up your Firefox settings in case something goes wrong. See [[Backing up your information]]. (You can copy your entire Firefox profile folder somewhere outside of the Mozilla folder.)
    Next, restart Firefox in Firefox's Safe Mode ([[Safe Mode]]) using
    Help > Restart with Add-ons Disabled
    In the dialog, click "Start in Safe Mode."
    If those features work correctly, this points to one of your extensions or custom settings as the problem.
    To also disable plugins, you can use this page:
    orange Firefox button ''or'' classic Tools menu > Add-ons > Plugins category
    Any change?

  • Creating a template in Pages is straight-forward as answered here previously. Is there and equivalent for iBooks Author which can start with a blank page and build up the template as required? or can one only adapt a ready made template?

    Creating a template in Pages is straight-forward as answered here previously. Is there an equivalent for iBooks Author which can start with a blank page and build up the template as required? or can one only adapt a ready made template? This has proved unsatisfactory to me so far. Lines are left in etc.

    There are two basic menus for fonts - one from the main menu bar and one from the toolbar. You can also bring up the font manage dialog.
    I don't recommend trying to hard to force an otherwise foreign font, as it inevitably needs to be usable/supported on iOS as well, and that can get tricky w/3rd party fonts, as an example, even with the expanded font support in the latest iBA.
    If you need to discuss fonts more, I suggest starting a new thread....preferably with a slightly more brief title, thanks.

  • Can't Delete Non-Editable Region in Template?

    Well, I can in existing templates but if I create a new one from an existing page using "Save as Template", when I try to delete a non-editable region in the template, DW won't let me.  I don't know why.  Aaaargh!
    It's my understanding I should be able to edit anything in a template.  I've tried existing DW and restarting.  I've tried using other pages as a basis for the template.  Every template I create won't let me delete non-editable regions.  I'm highlighting the non-editable region and pressing the delete key.  I can't delete.

    burro_mail wrote:
    Not sure DW is doing what you describe...
    But I am certain you could remove the region in code view.
    Even if you are a WYSIWYG-er and not a big code-head, it should be pretty easy to remove the region markers and everything between them...
    Trust me, it is.  I'm wondering if the problem is associated with the fact that the source page that I saved as a template was based on a template?  I just noticed that this new template refers to another template.  I'm thinking that means the other template is controlling what I'm trying to do in the current template.
    That's it.  I just tried saving a template under a different name (still retaining the correct template file extension) but did not do the save as template.  Now I can completely edit that template.  So you if you save a page that is controled by a template, as a template, that new template is controlled by the previous template.
    I've got a headache now.

  • How do you fill in a form that was saved as a template? When I try, the "template" shifts, which is not how a template should work!

    How do you fill in a form that was saved as a template? When I try, the "template" shifts, which is not how a template should work!
    Templates, as I understand them, are fixed; you can "fill them in" without shifting them. Yet, I've saved doc as a template AND it shifts. Argh!

    Thanks for your response.
    I've managed to fix it but I wouldn't recommend the following as I'm sure its unsupported and I'll probably have problems down the line
    On the host
    * mv /etc/zones /etc/zones.bak
    * reboot single user
    * apply kernel patch (the one that ultimately I had to get on and which was giving pre-req dependency errors when running zones)
    * create a new zone now that host system is all up to date
    * Copy the operating system directories of the new zone (the one that's all patched) over the troublesome zone (the one that can't take the patch). Take backups first
    * cd /zones/new-zone/root
    * find sbin -print | cpio -pudm /zones/bad-zone/root
    * find usr -print | cpio -pudm /zones/bad-zone/root
    * find lib -print | cpio -pudm /zones/bad-zone/root
    * cd /zones/new-zone/root/var
    * find sadm -print | cpio -pudm /zones/bad-zone/root/sadm (this copies patches and pkgs directories and I'm sure a lot of other stuff that I didn't want)
    * mv /etc/zones.bak /etc/zones
    * reboot host
    * boot the old zone up. It should now have up to date patches
    I'm sure there are real no-no's in taking this approach but it seems to have worked for me. I'll update if I find there are some horrors down the line
    Edited by: paul_xedos on Mar 25, 2010 4:07 AM

  • Rainbow wheel appears when I open Firefox - then it hangs and all I can do is force-quit.

    I have uninstalled and reinstalled Firefox on my Macbook Pro. The same thing keeps happening - I open Firefox and the rainbow wheel appears - that's it. I have tried to reset Firefox (I was able to click a "reset" button yesterday but nothing happened. I tried to reset it today but an unable to do so). All I can do is force quit the application. I think resetting it to default might work but I cannot write anything in the address bar or click on any of the tabs because the rainbow wheel is the only thing that appears. This has never happened before and I don't know what's going on.
    Thank you in advance for your help.

    Press the '''Alt''' or '''F10''' key to bring up the tool bar. Then select
    '''Bookmarks'''. Hot key is '''<Control>''(Mac:<Command>)''<Shift> B.'''
    Once the window is open, at the top of the page, press the button labeled
    '''Import and Backup.''' Select '''Export Bookmarks To HTML,''' and follow
    the prompts and save it to a '''HTML''' file. Copy the file to another computer.
    Repeat the instructions above, BUT select '''Import Bookmarks From HTML,'''
    These can't get your data back, but will help in the future.
    These add-ons can be a great help by backing up and restoring Firefox
    '''[https://addons.mozilla.org/en-US/firefox/addon/febe/ FEBE (Firefox Environment Backup Extension)]''' {web link}
    FEBE allows you to quickly and easily backup your
    Firefox extensions, history, passwords, and more.
    In fact, it goes beyond just backing up -- It will actually rebuild
    your saved files individually into installable .xpi files.
    It will also make backup of files that you choose.
    '''[https://addons.mozilla.org/en-US/firefox/addon/opie/ OPIE]''' {web link}
    Import/Export extension preferences

Maybe you are looking for