View Single Post
  #14   Report Post  
Posted to microsoft.public.excel.programming
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default Adding hints to my vb functions

So what is the best way around this issue?

To answer your question... I have no idea.<g I came up with the solution I
offered by reading the help files and experimenting... I never did it before
and it wouldn't have occurred to me to try to do it except for the fact the
OP asked the question.

--
Rick (MVP - Excel)


"Ron Rosenfeld" wrote in message
...
On Sat, 7 Mar 2009 11:51:53 -0500, "Rick Rothstein"
wrote:

Use the MacroOptions property of the Application object to do that...

Application.MacroOptions Macro:="FunctionName", Description:="Text to
show"

where you would replace "FunctionName" with your function's name (with
quote
marks around it as in my example) and the "Text to show" description with
the description you want to show for your function.

Note that you can't put this statement inside your function... it needs to
be run outside of it, perhaps in the Workbook_Open event procedure.

--
Rick (MVP - Excel)


Rick,

My UDF's and custom macros are all in an add-in.

I can run the macro "normally" after Excel has loaded.

e.g:

======================
Option Explicit
Sub Assign()
With Application
.MacroOptions Macro:="RECount", _
Description:="Count of substrings matching Regex", _
Category:="Regular Expressions"
.MacroOptions Macro:="Enable", Description:="Re-Enable Events"
End With
End Sub
==============================

If I try to run this as in the Workbook_Open event of my add-in, it
returns an
error message --

----------------------
Run-error '1004':

Cannot edit a macro on a hidden workbook. Unhide the workbook using the
Unhide
command.
----------------------

This is true whether the macro is placed directly in the Workbook module;
or if
the Workbook_Open event "calls" the above Sub which is in a regular
module.

So what is the best way around this issue?

Thanks.
--ron