24

I am trying to isolate the issue causing

Excel 4.0 function stored in defined names.

Excel Issue During Save

3
  • Do you have any defined names? If so, list them and see what they Refer To: Commented Sep 28, 2014 at 19:13
  • @RonRosenfeld Yes I have names that point to tables and data validation lists that point to formulas something like =INDIRECT("TableName[Column_Header_Name]") is this a problem?
    – Ayusman
    Commented Sep 29, 2014 at 3:04
  • What you post is not a problem; but "something like" is not what you are really using. Have you assured yourself that NONE of your defined names are the same as the name of an xlm4 macro? If you have, then you'll need to remove your defined names one by one until you find the one that is causing the problem. Commented Sep 29, 2014 at 3:25

10 Answers 10

45

Not to bump an old thread, but I had this same issue as well and wanted to post my resolution in case anyone else experiences the same thing as myself.

My problem ended up being caused by a MySQL Excel COM add-on that was a component included in the MySQL Workbench package. Disabling that add-on caused the macro prompt to disappear when saving spreadsheets.

4
  • 12
    Worked for me. To disable it, click the File tab, click Options, and then click the Add-Ins category. In the Manage box, click COM Add-ins, and then click Go. The Add-Ins dialog box appears. In the Add-Ins available box, deselect MySQL check box, and click OK. Commented Jun 23, 2015 at 19:00
  • 2
    To add to this, you will need to restart Excel for the change to take effect.
    – BitBug
    Commented Aug 3, 2015 at 18:15
  • 1
    Based on the above suggestion I just ran MySQL Installer and removed MySQL for Excel and that fixed it for me.
    – Matt M.
    Commented Sep 21, 2015 at 19:01
  • Apparently it's fixed in the MySQL for Excel 1.3.5 release. bugs.mysql.com/bug.php?id=73467
    – Jeff Lewis
    Commented Nov 28, 2015 at 19:56
13

For me this message was caused by the MySQL For Excel COM Add-In. The message stopped appearing when I unloaded the COM Add-In.

6

The solution already pointed out is correct: disable the MySQL for Excel COM Add-in.

The reason for the message is that this add-in adds hidden names to the workbook. These names are not visible in the Excel Names Manager. But you can see them in the VBA Direct Window if you add this code to a workbook module:

Public Sub DEV_CheckNames()

Dim n As name
For Each n In ActiveWorkbook.Names
    If Not n.Visible Then
        Debug.Print n.NameLocal, n.RefersToLocal
        'If you want to delete the name, uncomment this line:
        'n.Delete  
    End If
Next
End Sub

Result (for a German instance of Excel 2013):

LOCAL_DATE_SEPARATOR        =INDEX(ARBEITSBEREICH.ZUORDNEN(37);17)
LOCAL_DAY_FORMAT            =INDEX(ARBEITSBEREICH.ZUORDNEN(37);21)
LOCAL_HOUR_FORMAT           =INDEX(ARBEITSBEREICH.ZUORDNEN(37);22)
LOCAL_MINUTE_FORMAT         =INDEX(ARBEITSBEREICH.ZUORDNEN(37);23)
LOCAL_MONTH_FORMAT          =INDEX(ARBEITSBEREICH.ZUORDNEN(37);20)
LOCAL_MYSQL_DATE_FORMAT     =WIEDERHOLEN(LOCAL_YEAR_FORMAT;4)&LOCAL_DATE_SEPARATOR&WIEDERHOLEN(LOCAL_MONTH_FORMAT;2)&LOCAL_DATE_SEPARATOR&WIEDERHOLEN(LOCAL_DAY_FORMAT;2)&" "&WIEDERHOLEN(LOCAL_HOUR_FORMAT;2)&LOCAL_TIME_SEPARATOR&WIEDERHOLEN(LOCAL_MINUTE_FORMAT;2)&LOCAL_TIME_SEPARATOR&WIEDERHOLEN(LOCAL_SECOND_FORMAT;2)
LOCAL_SECOND_FORMAT         =INDEX(ARBEITSBEREICH.ZUORDNEN(37);24)
LOCAL_TIME_SEPARATOR        =INDEX(ARBEITSBEREICH.ZUORDNEN(37);18)
LOCAL_YEAR_FORMAT           =INDEX(ARBEITSBEREICH.ZUORDNEN(37);19)

These names are added to the active workbook in the moment you click on the button of the add-in (which opens the taskpane). Unfortunately, I haven't found out yet why the MySQL add-in sometimes adds these names by itself without being activated.

Added: This is a known bug in the MySQL for Excel add-in as of http://bugs.mysql.com/bug.php?id=73467

4

I have the same problem in Excel 2013 and was solved by unloading the MySQL Add in - I did this by going to FILE - OPTIONS - Add Ins

3

I ran into this warning after creating the following defined name:

Name: wsNamesArray

Refers To: =RIGHT(GET.WORKBOOK(1),LEN(GET.WORKBOOK(1))-FIND("]",GET.WORKBOOK(1)))

This formula returns an array with names for each sheet in the workbook. I was using it to return the names of various sheets (first, last, previous and next sheet).

The problem is that this formula uses the GET.WORKBOOK Excel 4 function. From what I understand this is something like a VBA macro imbedded in a function. To save that functionality the Excel workbook must be saved in a format that allows macros such as .xlsm or .xlsb (or any of several other file types).

My choices were to delete the defined name containing an Excel 4 function or to replace the defined name with a formula without the Excel 4 function,

1

As in ChipsLetten's answer, same solution here on my computer: On saving some (actually macro free) workbook, I get an alert "Excel 4.0 function stored in defined names", and an option to save the workbook as "macro-enabled". On de-activating the "MySQL for Excel" COM-Add-in, the alert does not appear any more.

In order to disable the "MySQL for Excel" add-in (if you ever have installed it): Tab "Developper", then button "COM Add-Ins", and you get a list of add-ins that you can enable or disable per tick-mark.

0

have you installed some connector for excel?, maybe that's causing the issue, just uninstall it and the error will be gone.

0

If you have worksheets with hidden ranges as described in domke consulting's answer, you can use the following code to remove them:

Public Sub Remove_Hidden_MySQL_Names()

Dim n As Name
For Each n In ActiveWorkbook.Names
    If Not n.Visible Then
        'Delete Names added by MySQL for Excel add-in
        If (InStr(n.NameLocal, "LOCAL_") <> 0 And (InStr(n.NameLocal, "_FORMAT") <> 0 Or _
                                                    InStr(n.NameLocal, "_SEPARATOR") <> 0)) Then
            Debug.Print "Would delete", n.NameLocal, n.RefersToLocal
            'If you want to delete the name, uncomment this line:
            'n.Delete
        Else
                Debug.Print "Keeping", n.NameLocal, n.RefersToLocal
        End If
    End If
Next
End Sub
0

For me, in 2020, this issue is caused due to the fact that you want to save it into a .xlsx format. It needs to be saved in a .xls .xlsm or .xlsb file, which are macro enabled files. .xlsm is the preferred option.

0

I just want to add my own part to this, as I stumbled onto this when trying to fix the same issue. However in my case what had happened is I was using the LET function for testing as I was writing a huge formula and didn't want to repeat myself. I had used LET to define a long lookup, which once I was happy the formula was working I removed the LET function and made it a backwards compatible function (as although I'm on 365, the users are anywhere from Excel 2007 to 365 so I need to cover everything).

However, as I'd used LET and this is a new function, I actually had a hidden named range within the sheet that Excel used to note for backward compatibility when the LET function has been used. This hidden named range was

_xlpm.highest = #NAME?

Where "highest" was the variable name I'd assigned using LET. I found this using this code

Public Sub DEV_CheckNames()
Dim n As Name
For Each n In ActiveWorkbook.Names
    If Not n.Visible Then
        Debug.Print n.NameLocal, n.RefersToLocal
        'If you want to delete the name, uncomment this line:
        'n.Delete
    End If
Next
End Sub

from the answer above, and then also using this code

Sub CleanNames()
   Dim Nm As Name
   For Each Nm In ActiveWorkbook.Names
      Nm.Visible = True
   Next Nm
End Sub

From this forum post which allowed me to unhide and delete the rogue named range in question. I was able to save properly without the error after that. Wanted to add this on in case anyone else happens to have my same case and I can save people some time!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.