+ Reply to Thread
Results 1 to 5 of 5

Forced format choice when saving

  1. #1
    Registered User
    Join Date
    01-11-2017
    Location
    California
    MS-Off Ver
    Office 365 Mac
    Posts
    23

    Forced format choice when saving

    I am trying to force users to save as xlsm only, and found the following example:

    http://mattiaslundstedt.com/force-sa...-macro-enabled

    In the first reply it asks the same question I am stuck with... I want to use this as a template. He offers a partial answer, but even just attempting this without the template option which I dont understand... just forcing xlsm, I get a compile error: syntax error

  2. #2
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Forced format choice when saving

    That macro appears to do all you want.

    If the user tries to use the Save As option the filename type box defaults to .xlsm and only offers that. The user can't choose .xlsx or anything else for that matter.
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  3. #3
    Registered User
    Join Date
    01-11-2017
    Location
    California
    MS-Off Ver
    Office 365 Mac
    Posts
    23

    Re: Forced format choice when saving

    I think I see... its specifying SaveAs only? when I try to simply save I get the syntax error.

    Just tried again and I get no error and no saved file.

    Please Login or Register  to view this content.
    I had to change it from xltm to xlsm to upload it. Code removed as well so I could save it. I'm not sure there is a better way to accomplish this.
    Attached Files Attached Files

  4. #4
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Forced format choice when saving

    Here's a .xltm file

    In order to save the original .xlsm file as a .xltm I needed to add a small procedure to save the file since the Before Save macro normally prevents saving as a different name. However the line of code
    Please Login or Register  to view this content.
    only prevents a user (that's the UI or User Interface bit) from saving as a different file type but code can save with a different type.

    Apparently the forum doesn't allow .xltm files so I've uploaded a .zip file that contains the .xltm
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    01-11-2017
    Location
    California
    MS-Off Ver
    Office 365 Mac
    Posts
    23

    Re: Forced format choice when saving

    Ty, didnt think to simply zip it.

    I am still seeing the last problem mentioned on my end. when I save I dont not get a saved file. when I try to close the file I get the option to save but still no saved file. When I do a SaveAs, I get nothing. no UI at all

+ 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. Multiple Time Stamps depending on choice in Drop Down List Choice
    By insayah in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-25-2022, 09:53 AM
  2. Multiple Choice Conditional Format
    By droddis in forum Excel General
    Replies: 6
    Last Post: 03-13-2017, 11:30 AM
  3. Make an multiple choice quiz with randomized choice
    By shaterroi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 12-16-2015, 11:04 AM
  4. Replies: 3
    Last Post: 12-09-2013, 04:21 AM
  5. Replies: 2
    Last Post: 07-10-2012, 04:37 PM
  6. Forced recalculation
    By hege in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-20-2005, 04:40 PM
  7. Forced Format
    By Scott Hutchinson in forum Excel General
    Replies: 2
    Last Post: 02-18-2005, 10:06 AM

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