Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Add help text to custom functions in Excel

Add help text to custom functions in Excel

Scheduled Pinned Locked Moved C#
csharpwpfwcfcomtesting
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jimjo
    wrote on last edited by
    #1

    Hi gurus, I have an automation add-in created using C# for Excel, in which I am exposing a number of functions. Is there any way I can add help-text the way excel does for other categories like Financial, Statistical, etc. The place I want my help-text to be available is in the Insert->Function. Here, we can select a category and function. The corresponding help text is displayed. Now, my automation add-in is also listed in this categories. I want help text to be displayed when a user selects my add-in and functions in it. I tried the MacroOptions method, but it is raising an exception. This is the code I tried (I tried both early binding and late binding): early binding: code: _excelApplication.MacroOptions("Report_Alloc", "custom description", Missing.Value, Missing.Value, Missing.Value, Missing.Value, "Report.Report", Missing.Value, Missing.Value, Missing.Value); Exception Message: "Exception from HRESULT: 0x800A03EC." StackTrace " at Microsoft.Office.Interop.Excel._Application.MacroOptions(Object Macro, Object Description, Object HasMenu, Object MenuText, Object HasShortcutKey, Object ShortcutKey, Object Category, Object StatusBar, Object HelpContextID, Object HelpFile)\r\n at ....... late binding: code: object[] parameters = new object[10]; parameters[0] = "Report_Alloc"; parameters[1] = "Some sample description..."; parameters[2] = Missing.Value; parameters[3] = Missing.Value; parameters[4] = Missing.Value; parameters[5] = Missing.Value; parameters[6] = "Report.Report"; parameters[7] = Missing.Value; parameters[8] = Missing.Value; parameters[9] = Missing.Value; _excelApplication.GetType().InvokeMember("MacroOptions", BindingFlags.InvokeMethod | BindingFlags.Public | BindingFlags.Instance, null, _excelApplication, parameters, new System.Globalization.CultureInfo("en-US")); Exception Message: "Exception has been thrown by the target of an invocation." StackTrace " at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters)\r\n at System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParameters)\r\n at ...... Inner Exception Message: "MacroOptions method of Application class failed" Any help would be appreciated..... Jim

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups