Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5960235
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:47:54+00:00 2026-05-22T18:47:54+00:00

I have an excel template that uses a macro to save the file, so

  • 0

I have an excel template that uses a macro to save the file, so that the users maintain standardized file name formats. I created the code using Excel 2003. the code is as follows:

Sub SaveBook()
   Dim sFile As String
   sFile = "ConsolidatedDemand" & "_" & Format(Now(), "yyyy.mm.dd") & ".xls"
   ActiveWorkbook.SaveAs Filename:= "\\file location\" & sFile
End Sub

I have one user who uses Excel 2007. When they try to run the macro, they recieve an error:
“The following features can not be saved in macro-free workbooks: VB project.
To save a file with these features, click No, and then choose macro-enabled file type in the file type list. To continue saving as a macro-free workbook, click yes”

I tried chaing the file extension to “.xlsm” in the second line of code, but that yielded the same error message. Any other ideas of how I can modify this code so that it will work for Excel 2007 users?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T18:47:55+00:00Added an answer on May 22, 2026 at 6:47 pm

    (taken from: http://blogs.office.com/b/microsoft-excel/archive/2009/07/07/use-the-vba-saveas-method-in-excel-2007.aspx)

    In Excel 2007, the SaveAs method requires you to provide both the FileFormat parameter and the correct file extension.

    For example, in Excel 2007 this line of code will fail if the ActiveWorkbook is not an .xlsm file:

    ActiveWorkbook.SaveAs "C:\ron.xlsm"
    

    But this code will always work:

    ActiveWorkbook.SaveAs "C:\ron.xlsm", fileformat:=52 
    

    These are the main file formats in Excel 2007:

    • 51 = xlOpenXMLWorkbook (without macro’s in 2007, .xlsx)
    • 52 = xlOpenXMLWorkbookMacroEnabled (with or without macro’s in 2007,
      .xlsm)
    • 50 = xlExcel12 (Excel Binary Workbook in 2007 with or without
      macro’s, .xlsb)
    • 56 = xlExcel8 (97-2003 format in Excel 2007, .xls)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an Excel 2003 workbook that contains a macro to copy certain of
Good Afternoon, I have a an Excel template file - which contains Macros -
I seem to have a dilemma. I have an EXCEL 2003 template which users
I have an Excel template that I use to create PDF specification sheets for
I have a an excel file that has been manually populated, and now needs
I have two excel files. First excel file contains the Person Name and Total
I have Excel add-in which I add so many class modules that it is
We have an Excel 2002/XP based application that interacts with SQL 2000/5 to process
I have an excel spreadsheet in a format similar to the following... | NAME
I have an excel file which has more than 65536 rows. However, I can

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.