There is a workaround that has proven successful for those who are confronted with this problem. It is simply to add a BAS file to a working Smart View workbook and in this BAS file put the following function declarations and conversion routine:
' Function Smartview VBA Declaration.
Declare Function HsGetValue Lib "HsAddin" (ParamArray MemberList() As Variant) As Variant
Declare Function HsSetValue Lib "HsAddin" (ByVal Value As Variant, ParamArray MemberList() As Variant) As Variant
Declare Function HsGetText Lib "HsAddin" (ParamArray MemberList() As Variant) As Variant
Declare Function HsSetText Lib "HsAddin" (ByVal text As Variant, ParamArray MemberList() As Variant) As Variant
Declare Function HsLabel Lib "HsAddin" (ParamArray MemberList() As Variant) As Variant
Declare Function HsDescription Lib "HsAddin" (ParamArray MemberList() As Variant) As Variant
Declare Function HsCurrency Lib "HsAddin" (ParamArray MemberList() As Variant) As Variant
'**************************************************************************
' For converting existing XLA cell functions to use a local function reference
'**************************************************************************
Sub ConvertFunctionsToLocal()
ActiveWorkbook.ChangeLink "HsTbar.xla", ThisWorkbook.FullName, XlLinkType.xlLinkTypeExcelLinks
End Sub
Running the conversion routine will change all of the current cell functions to use the functions declared in the workbook instead of the functions declared in HsTbar.xla.
And that's it. The workbook will be a self-contained solution that can be passed around or placed in a Citrix environment without the worry of broken links.
4 comments:
Hi Matt
The information is really helpful.
I need one more information of where you have found these functions as I was not able to see those in smartview.bas file. Do you have a reference for this?
These functions are not normally contained in the SmartView.bas file. You will need to add them to the bas file in order to override the default Smart View behavior for functions.
Hi Mike,
would it be possible to provide a short description what exactly needs to be done in order to add the BAS file to the workbook with hsgetvalue functions?
Thank you for any hints.
- Open the Excel workbook.
- ALT-F11 to open the VBA editor.
- Right click on Excel Objects folder.
- Select Insert | Module
- Copy and paste the code from this blog into the newly created module (i.e. BAS file).
Post a Comment