-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unknown Function ".Index" in German Excel #4
Comments
Thanks @markibarki for reporting this issue. It looks like the error occurs because of the default value for the optional
I suspect the "Help" menu in your German Excel has a different name (caption). So when the code on line 47 tries to find that menu by this default English name, it doesn't find the menu. Therefore, the sub-expression:
returns Nothing, which of course, does not have ".Index" function. To confirm this, could you please restore
Replace "(HELP-MENU-NAME)" with the name of the Help menu as it appears in your Excel. |
I have tested your suggestion, but it doesn't work. I got the same error message. I also tried to add a custom menu "Help" (and in German "Hilfe"), but also then I got the same error. When I run the following code to print the menu names, I got English names also in my German Excel:
Output:
There is no item "Help" in the resulting list. But also if I try to use "Formula Bar" it doesn't work. It looks like the function ".Index" is generally not available. |
Sorry @markibarki for the delay in responding. That's interesting that the command bars have English names, but in some way, that does make sense, because then code accessing them would work regardless of language used in the Excel UI (German vs English vs ...). The "Help" menu is actually a member of the first command bar (the one named "Worksheet Menu Bar"). What output do you get when you enter this code snippet?
We might see "Hilfe" in the output. |
The output of your code is as follows:
If I change your code to |
Changed the default behavior for finding the Help menu -- we now look it by its control id (which is language-independent). This change still needs to be verified with a non-English version of Excel.
Thanks @markibarki for the additional information. I suspected that the Id of the "Help" menu (whose caption in your Excel is "&?") was 30010. So as noted above in the referenced commit, I modified the default behavior in the This change works fine with my English Excel, but it still needs to be tested to see if it works with another language. If you could download the latest pre-release (v1.3.0-rc.1), and check if it works without modification for your German Excel, I'd appreciate that. |
Closing this ticket because I just did the official release of v1.3.0. If this problem re-appears, we can always re-open this ticket then. |
In my German Excel version 2016 (16.0.4432.1000, 32-Bit) I get an "Unknown function"-error when I open "Simple Toolkit_DEV.xlam". It should be in menu_lib.bas:47 :
helpMenuIndex = mainMenuBar.Controls(insertBefore).Index
My fix to that is in line 48/49 where I change
Set customMenu = mainMenuBar.Controls.Add(Type:=msoControlPopup, Before:=helpMenuIndex)
to
Set customMenu = mainMenuBar.Controls.Add(Type:=msoControlPopup, Before:=mainMenuBar.Controls.Count)
Now, my Excel shows a new ribbon tab "Add-Ins" with the "Simple Tools (dev)" drop down menu as single element of this tab.
The text was updated successfully, but these errors were encountered: