View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Ron Rosenfeld Ron Rosenfeld is offline
external usenet poster
 
Posts: 5,651
Default Adding hints to my vb functions

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