Requirement 1:
I have developed an Excel Add-in.Whenever I install the addin in the excel workbook a toolbar is opened.
The code to open the toolBar is written in WorkBook_Open() method of workbook.
Now I close the workbook I want to disable my toolbar as there are not active sheet available in the workbook.
I have written the code to disable the toolbar in WorkBook_BeforeClose() method of workbook.But this is not working as when I close the workbook WorkBook_BeforeClose() event is not getting fired.This gets fired only when I close the Add-in Installed or when I Un-install the Add-in.
Code Snippet:
Private Sub Workbook_Open()
On Error GoTo HandleErr
g_sMarketAxessAddinFilenam
e = Me.Path
g_sMarketAxessAddinFilenam
eSansSuffi
x = getFileNameSansSuffix(Me.P
ath)
'This piece of code sets the project path and creates Market Axess menu.
Call setProjectPaths
createMarketAxessMenu
buildMAToolBar
'Setting the category in insert function menu.
Application.ScreenUpdating
= False
ThisWorkbook.IsAddin = False
'This function sets the MarketAxess Category.
Call addCategoryDescription
ThisWorkbook.IsAddin = True
Application.ScreenUpdating
= True
'finally, trick the add-in into thinking that it has been File / Save'd
ThisWorkbook.Saved = True
Exit Sub
HandleErr:
Call handleError(MAWRKBOOKOPEN_
ERR_NUM, Err, Now)
End Sub
Private Sub Workbook_BeforeClose(Cance
l As Boolean)
Set MValidationChecks.oXmlDocV
alidationF
ile = Nothing
Set ReadResponse.oXmlDocProper
tyFile = Nothing
disableMAToolbar
End Sub
Requirement 2:
I have added a custom category say "abc" in the excel which has many user defined function.
When I open any function in the custom category through Insert -> Function wizard, I want to show the description of the function,description of all the parameters of the function,data type of each parameter on the right side of the wizard.
Also I want to show mandatory parametes to appear in BOLD font and optional parameters to appear in PLAIN font.
Start Free Trial