473,387 Members | 1,463 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Adding help text to custom functions in Excel

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.

Any help would be appreciated.....

Jim

Mar 16 '06 #1
1 2614
This is the code I am using. I have tried both early and late binding.
I have also included the exceptions below.

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.MacroO ptions(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("MacroOpt ions",
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"

Jim

Mar 17 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Brian Conklin | last post by:
Hello Eneryone, I am having a problem. I have written a little app that will take a text "pipe" delimited file and place all of the values in to an Excel spreadsheet. It works great on any of my...
8
by: John Brock | last post by:
I am creating an Excel workbook using VB.NET, and have run into a problem. Excel at times insists on reformatting data that I enter into cells, e.g., converting "01234" to "1234", and this screws...
0
by: jim4u | last post by:
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...
11
by: Pete Kane | last post by:
Hi All, does anyone know how to add TabPages of ones own classes at design time ? ideally when adding a new TabControl it would contain tab pages of my own classes, I know you can achieve this with...
7
by: Eran.Yasso | last post by:
Hi, I have project that automate excel(using Excel COM) which works fine in my home. I took the project from my home to work and tried to build the project but it won't built. I get error "The...
12
by: Bob Jones | last post by:
I have an odd business requirement and I think that the implementation is not correct in the terms of OOP development. Any help on the concepts would be very appreciated! We currently have a...
1
by: rishiyo | last post by:
Good ones!! I want to retrieve and add datas with excel. I've tried one by adding two textboxes and two command buttons. THE code is: 'do declare these variables you need to add a reference'to...
2
by: pulavarthipraveen | last post by:
Overview: We have a requirement in the c#.NET 1.0 windows application. There will be some input text file in the user’s machine. The user should browse and select the input text file and also select...
2
by: Ken Fine | last post by:
I want to add the security question and answer security feature to the ChangePassword control. I am aware that this functionality is built into the PasswordRecovery tool. I have implemented the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.