Microsoft KB Archive/131112

{|
 * width="100%"|

BUG: Unloading Generic Sample Does Not Remove Custom Menu

 * }

5.00     | 5.00 MACINTOSH | WINDOWS kbprg kbbuglist

-

The information in this article applies to:


 * Microsoft Excel Software Development Kit, version 5.0

-

SYMPTOMS
When the Generic sample is loaded, it adds the Generic Menu to the Microsoft Excel worksheet menu bar. When Generic is unloaded, the Generic Menu is not removed.

CAUSE
In Microsoft Excel version 5.0, you can display either version 4.0 or version 5.0 menus. Generic adds a menu to bar 1 that under Microsoft Excel version 5.0 is mapped to bar 10. When the menu from bar 1 is deleted, the corresponding menu on bar 10 is not deleted.

RESOLUTION
To delete the menu the Generic sample added to the menu bar, change the menu bar number from 1 to 10 for all menu commands.

In the xlAutoOpen function do the following: Change:

  Excel(xlfGetBar,&xTest,3,TempInt(1),TempStr(" Generic"),TempInt(0)); To:

  Excel(xlfGetBar,&xTest,3,TempInt(10),TempStr(" Generic"),TempInt(0)); Change:

  Excel(xlfAddMenu,0,3,TempNum(1),(LPXLOPER)&xMenu,TempStr(" Help")); To:

  Excel(xlfAddMenu,0,3,TempNum(10),(LPXLOPER)&xMenu,TempStr(" Help")); In the xlAutoClose function do the following:

Change:

  Excel(xlfGetBar, &xRes, 3, TempInt(1), TempStr(" Generic"),TempInt(0)); To:

  Excel(xlfGetBar, &xRes, 3, TempInt(10), TempStr(" Generic"),TempInt(0)); Change:

Excel(xlfDeleteMenu, 0, 2, TempNum(1), TempStr(" Generic")); To:

Excel(xlfDeleteMenu, 0, 2, TempNum(10), TempStr(" Generic"));

STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.