+ Reply to Thread
Results 1 to 5 of 5

Force .xlsm to save as .xlsx or .xls in VBA

  1. #1
    Registered User
    Join Date
    03-14-2014
    Location
    Nashville, TN
    MS-Off Ver
    Excel 2010
    Posts
    11

    Force .xlsm to save as .xlsx or .xls in VBA

    I am trying to force a workbook to save as .xlsx format from a .xlsm workbook with a macro enabled button.

    In the vba code I force it as .xlsx but it still saves as xlsm?

    Please Login or Register  to view this content.
    when I run the code in the immediate window is sets the filename as
    "X:\Gordonsville\STARLINGS GORDONSVILLE\Cumberland Turnover\2014 Daily Equipment Usage\(3-17-2014) Day Gorwood DAILY EQUIPMENT USAGE.xlsx"

    but it still saves the file as
    "X:\Gordonsville\STARLINGS GORDONSVILLE\Cumberland Turnover\2014 Daily Equipment Usage\(3-17-2014) Day Gorwood DAILY EQUIPMENT USAGE.xlsm"

    whats going on here?

    Any help apprecaited.

    Thanks
    JR

  2. #2
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Force .xlsm to save as .xlsx or .xls in VBA

    Please Login or Register  to view this content.
    If you don't set the Fileformat then it will save as the same format as the current workbook. This may give you a pop up asking you if you're sure you want to save with macros.
    Thanks,
    Solus


    Please remember the following:

    1. Use [code] code tags [/code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    Highlight the code in your post and press the # button in the toolbar.
    2. Show appreciation to those who have helped you by clicking below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

    "Slow is smooth, smooth is fast."

  3. #3
    Registered User
    Join Date
    03-14-2014
    Location
    Nashville, TN
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Force .xlsm to save as .xlsx or .xls in VBA

    Thank you.

    Anyway to disable the pop up. the displayalerts.false is not taking care of this?

  4. #4
    Forum Expert Solus Rankin's Avatar
    Join Date
    05-24-2013
    Location
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012
    Posts
    2,655

    Re: Force .xlsm to save as .xlsx or .xls in VBA

    AFAIK the only way to suppress this specific message is to copy all sheets into an xlsx and save the new workbook.

    Another option would be to place the macro in a PERSONAL.xlsb and have it modify your workbook. In this manner your workbook will never need to be macro enabled.

  5. #5
    Registered User
    Join Date
    03-14-2014
    Location
    Nashville, TN
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Force .xlsm to save as .xlsx or .xls in VBA

    I think possibly the copy sheet may be the best option for now.

    Thanks for the advice and 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. [SOLVED] Macro That will save XLSM as XLSX
    By djfatboyfats in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-26-2013, 08:21 AM
  2. Data Validation and macro enabled workbook
    By titantough in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-12-2012, 12:55 AM
  3. VBA to save a copy of .xlsm workbook as .xlsx
    By lanziniad in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-20-2012, 02:00 AM
  4. how to save .xlsm fie as .xlsx
    By Blue_kul in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-04-2012, 10:38 PM
  5. Save as .xlsx and not as .xlsm with VBA code
    By Blue_Wings in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-22-2010, 04:37 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