Click here to Skip to main content
15,892,674 members
Home / Discussions / C#
   

C#

 
GeneralRe: equivalent code Pin
V.17-Mar-06 4:38
professionalV.17-Mar-06 4:38 
QuestionRotating image in C# Pin
CoolASL17-Mar-06 1:41
CoolASL17-Mar-06 1:41 
AnswerRe: Rotating image in C# Pin
JuanAlbertoMD17-Mar-06 3:41
JuanAlbertoMD17-Mar-06 3:41 
AnswerRe: Rotating image in C# Pin
Werdna17-Mar-06 5:20
Werdna17-Mar-06 5:20 
QuestionPath of current project. Pin
deepscyberpulse17-Mar-06 1:32
deepscyberpulse17-Mar-06 1:32 
AnswerRe: Path of current project. Pin
nidheeshkayal17-Mar-06 1:53
nidheeshkayal17-Mar-06 1:53 
AnswerRe: Path of current project. Pin
jimjo19-Mar-06 20:01
jimjo19-Mar-06 20:01 
QuestionAdd help text to custom functions in Excel Pin
jimjo17-Mar-06 1:26
jimjo17-Mar-06 1:26 
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
QuestionRichTextBox and SendKeys action Pin
conrado717-Mar-06 1:25
conrado717-Mar-06 1:25 
AnswerRe: RichTextBox and SendKeys action Pin
IdUnknown17-Mar-06 3:23
IdUnknown17-Mar-06 3:23 
GeneralRe: RichTextBox and SendKeys action Pin
conrado717-Mar-06 3:39
conrado717-Mar-06 3:39 
QuestionShow/Hide Quick Launch Toolbar on Button Click Pin
sherwani17-Mar-06 1:06
sherwani17-Mar-06 1:06 
QuestionHow to handle Window Context Menu events ? Pin
sherwani17-Mar-06 1:02
sherwani17-Mar-06 1:02 
AnswerRe: How to handle Window Context Menu events ? Pin
CoolASL17-Mar-06 3:41
CoolASL17-Mar-06 3:41 
GeneralRe: How to handle Window Context Menu events ? Pin
sherwani17-Mar-06 3:43
sherwani17-Mar-06 3:43 
AnswerRe: How to handle Window Context Menu events ? Pin
CoolASL17-Mar-06 3:58
CoolASL17-Mar-06 3:58 
QuestionHow to handleTwo events ? Pin
sherwani17-Mar-06 1:00
sherwani17-Mar-06 1:00 
QuestionIdentify opened ports in local machine Pin
deepthi wilson17-Mar-06 0:03
deepthi wilson17-Mar-06 0:03 
AnswerRe: Identify opened ports in local machine Pin
Jijo BP17-Mar-06 0:07
Jijo BP17-Mar-06 0:07 
AnswerRe: Identify opened ports in local machine Pin
Vasudevan Deepak Kumar17-Mar-06 0:45
Vasudevan Deepak Kumar17-Mar-06 0:45 
QuestionOpen only one child form Pin
Boipelo16-Mar-06 22:47
Boipelo16-Mar-06 22:47 
AnswerRe: Open only one child form Pin
akyriako7816-Mar-06 23:47
akyriako7816-Mar-06 23:47 
AnswerRe: Open only one child form Pin
pawan kumarsoft4-Nov-10 6:20
pawan kumarsoft4-Nov-10 6:20 
QuestionHashtable Pin
Eytukan16-Mar-06 22:34
Eytukan16-Mar-06 22:34 
AnswerRe: Hashtable Pin
Nicholas Butler16-Mar-06 23:31
sitebuilderNicholas Butler16-Mar-06 23:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.