Logo 
Search:

MS Office Answers

Ask Question   UnAnswered
Home » Forum » MS Office       RSS Feeds
  Question Asked By: Kiral Demir   on Dec 15 In MS Office Category.

  
Question Answered By: Laurel Collins   on Dec 15

my Add-in contains a function

Function DStr(Date_Value As Date) As String
..
End Function

In the module "ThisWorkbook" I have the following procedure:

Private Sub Workbook_Open()
...
Application.MacroOptions Macro:="DStr", Category:=2, _
Description:="Converts Microsoft Excel's date format to a text string
'mmm dd, yyyy'.", _
HelpContextID:=HID, HelpFile:=ELP + FHlp
End Sub

This code does the following:
* assigns my functions  to category 2 which is "Date & Time" (by default your
function is assigned to the category "User Defined")
* it adds the above description to the "Insert Function" window.
* HID is the assigned number  in my help  file to describe the function  when
clicking help
* ELP is the path where my help file  is (Excel Library path) and defined  earlier
in the code:
ELP = Application.LibraryPath & Application.PathSeparator
* FHlp is the name of the help file defined as a public constant:
Public Const FHlp = "wqn.hlp" 'File: Help

Share: 

 
 
Didn't find what you were looking for? Find more on defining variables in function Or get search suggestion and latest updates.


Tagged: