Home → Troubleshooting → @RISK for Excel: Simulation → "The Excel name "..." has a character not in the current code page."
Applies to: @RISK 5.0–7.0 only
When I try to run a simulation, I get the error message
The Excel name "..." has a character not in the current code page.
with some name shown within the quotes.
You have one or more Excel names that are not in the character set for your Windows regional settings. For example, you'll get this message if you have any of the Western European regional settings, and an Excel name contains Asian or Greek letters.
Your best solution, if you have a current maintenance contract, is to upgrade to the latest version. Starting with 7.5.0, @RISK has improved Unicode support so that code pages are no longer a concern. However, if you don't have a maintenance contract and don't want to purchase an upgrade, you can use one of the following solutions.
Suggestion 1: If you have any workbooks open that are not part of your simulation, close them and try the simulation again. If the message doesn't appear again, then the problem names were in the unneeded workbooks that you closed. (In a simulation, @RISK simulates all open workbooks.)
Suggestion 2: You could change the Windows Region and Language settings to match those of the person who sent the workbook to you. If you don't want to do that, or don't have privilege, then you will need to edit the workbook so that all the names use only valid characters for your regional settings.
Note: The message tells you which Excel name is a problem, but not which workbook it's in. Therefore, if you have multiple workbooks open, you'll need to follow these suggestions for each open workbook.
Suggestion 3: If you have Excel 2007 or later, try converting the workbook to XLSB format. This worked for one customer, and it's easier than the suggestions below, so you may want to give it a try. (As a bonus, you may find that large files open faster, according to When should the xlsm or xlsb formats be used? at StackOverflow.com.
Suggestion 4: Inspect the names in Name Manager, as follows:
Get into Excel's Name Manager:
Scan the list for any non-Roman characters. They sort alphabetically after the Roman letters, so any name that seems to be out of alphabetical sequence is worth a closer look. (You want to scan the whole list, because if there's one problem name there may well be others. If you miss any, you'll get the message again when you try a simulation.)
Change any problem names to all Western European characters, and make the corresponding changes in your formulas.
Save your workbook, probably under a new name so that you can go back to the original if you need to.
Suggestion 5: If you can't find the problem name, it might be hidden. Here are three alternative ways to find and remove hidden names. Use caution in deleting names. If the logic of the workbook depends on the name, then it will not work correctly if the name is deleted.
This macro makes all hidden names visible and all visible names hidden. Run it once, delete or edit any of the formerly-hidden names that are a problem, and run it again.
Sub SwitchNamesVisibility() Dim n As Name, lVis As Long, lHid As Long For Each n In ActiveWorkbook.Names If n.Visible Then lVis = 1 + lVis Else lHid = 1 + lHid n.Visible = Not n.Visible Next n MsgBox ActiveWorkbook.Names.Count & " name(s) processed." & Chr(13) & Chr(10) & _ "I hid " & lVis & " visible names and made " & lHid & " hidden names visible." End Sub
Microsoft has a Knowledge Base article, Macro to Remove Hidden Names in Active Workbook. It will step through all the names in the workbook, tell you whether each one is visible or hidden, and give you the option to delete it.
If you have a lot of defined names, that can be tedious. Here is a macro that asks you for a name. If the name exists, the macro gives you information about the name and makes it visible. The macro then gives you the option to delete the name.
Sub FindName() Dim ans, sName, oName sName = InputBox("Which name are you trying to find?", "Name locator") On Error Resume Next Set oName = ActiveWorkbook.Names(sName) If Err <> 0 Then MsgBox "The name '" & sName & "' doesn't exist in the active workbook." Exit Sub End If On Error GoTo 0 With ActiveWorkbook.Names(sName) ans = MsgBox("Parent's name: " & .Parent.Name & Chr$(10) & "Visible? " & .Visible & _ Chr$(10) & "Refers to: " & .RefersTo & _ Chr$(10) & Chr$(10) & "Shall I delete the name from this workbook?", _ vbYesNo + vbQuestion + vbDefaultButton2, "About the name '" & sName & "'") .Visible = True If ans = vbYes Then .Delete MsgBox "Name deleted. Remember to save the workbook!" End If End With End Sub
Last edited: 2017-05-08