+ Reply to Thread
Results 1 to 4 of 4

Make code to run in excel 2007

  1. #1
    Registered User
    Join Date
    01-25-2013
    Location
    Viet Nam
    MS-Off Ver
    Excel 2007
    Posts
    7

    Make code to run in excel 2007

    Helo everybody,
    I had one macro, but it works good in excel 2003, I can not save as it to *xlsx, when I try it, excel is giving me the following error:
    The following features cannot be saved in macro-free workbooks:

    o VB project

    To save a file with these features, clikc No, and then choose a macro-enabled file type in the File Type list.
    To continue saving as a macro-free workbook, click Yes.

    The result of this error is incompatibility format between excel 2003 and excel 2007.

    Actuall, I want save it to *xlsx and combine it with some another macros.
    So, can you hepl me to fix this code and make it easy to run in excel 2007 ?
    This is code:
    Please Login or Register  to view this content.
    Please highlight where you fix.

    Thanks all.
    Last edited by ginkgo56; 01-27-2013 at 10:19 AM.

  2. #2
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Make code to run in excel 2007

    Hi, ginkgo56,

    *.xlsx is the macrofree fileformat, you need to save as *.xlsm/*.xlsb in order to hold the VBA. Maybe have a look at Use VBA SaveAs in Excel 2007-2010.

    An option could be to use the personal macro workbook or an addin to store the macros.

    Please use Code-Tags around your code as required by Forum Rule #3. TIA.

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  3. #3
    Registered User
    Join Date
    01-25-2013
    Location
    Viet Nam
    MS-Off Ver
    Excel 2007
    Posts
    7

    Re: Make code to run in excel 2007

    Actualy, i'm just a new mem to learn about vba, this one is difficult with me. Can you help me?
    I will attach file for you. This is excel 2003. I Just want to change it to excel 2007. This is very useful with me.

    Thanks alot.
    Attached Files Attached Files

  4. #4
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Make code to run in excel 2007

    Hi, gingko,

    no matter how often you will ask for it: itīs simply not possible to store VBA-Code in the xlsx (macroFREE) File Format. Besides I simply hate code that turns events and settings off but doesnīt turn them on again at the end. And the function for the lastrow is called twice in the same loop of the code.

    Code is slightly altered, attached as xlsm:
    Please Login or Register  to view this content.
    Ciao,
    Holger
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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