How do I enable my MenuItem ?

I am unable to get my newly added MenuItem enabled !

[code] // Set the MenuItem’s Text, Tag and Enable it
TheMenu.Text = MenuName
TheMenu.Tag = RecentFI
TheMenu.Enabled = True

    // Add this MenuItem to the RecentMenu (Menu)
    RecentMenu.Append  TheMenu
    RecentMenu.Enabled = True[/code]

RecentMenu is a Menu in the MenuBar.

The code is in App.Open.

Xojo 2015r1 / El Capitan 10.11.5

Turn off AutoEnable:

TheMenu.Text = MenuName TheMenu.Tag = RecentFI TheMenu.AutoEnable = False TheMenu.Enabled = True

Hi Eli (and thank you),

No, nothing changed.

FWIW: I added RecentMenu.Enabled in WIndow1.MouseDown, in Window1.EnableMenuItem, etc. to no change.

Reading your answer leads me to think about:

[quote] // Add this MenuItem to the RecentMenu
RecentMenu.Append TheMenu
RecentMenu.Enabled = True[/quote]

These lines were after the TheMenu filling lines. I placed above, but no change.

Could this have anything to do with it?
(From the LR)

http://documentation.xojo.com/index.php/MenuItem.Enabled

Hi Albin,

thank you for your answer. Nothing related to that.

In fact, there is a join error: 50% Xojo (who let me code it) and 50% me (who coded yesterday with bad glasses).

The answer was in my way to add a MenuItem, a way who works at 50% but who is wrong. In (for) the save part of the feature, I added a MenuItem SubClass and that worked fine, good, correctly, and so on.

Once at home, I took the correct glasses, get an eye on the Add MenuItems from the first part and saw that MenuItem SubClass. Once I use the same kind of code, the newly added code worked like a charm !

Sorry for the spend electrons