I am trying to isolate the issue causing
Excel 4.0 function stored in defined names.
I am trying to isolate the issue causing
Excel 4.0 function stored in defined names.
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.
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.
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
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
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,
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.
have you installed some connector for excel?, maybe that's causing the issue, just uninstall it and the error will be gone.
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
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.
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!