1007 Objects and Add-Ins
Note the use of the dot (.) operator to refer to functions in the Server.
Although we can use functions with unique names in the Server without
explicitly referring to the Server, this practice is frowned upon, and we
should always say that a function is not local when referring to it. Here
is the output produced when this macro is run:
Sub ClientServer()
Dim S As String ‘ The message string
‘--- Next line: Title for MsgBox
Const T As String = “Client Server Demo Reporting”
S = “Func1 is “ & Func1 & vbCr ‘ What is Func1
‘ Here?
MsgBox S, vbInformation, T ‘ Report progress
‘--- Next line adds to Message line What is FuncC
‘ Here?
S = S & “FuncC is “ & FuncC & vbCr ‘
MsgBox S, vbInformation, T ‘ Report progress
‘--- Next line adds to Message line What is FuncS
‘ Here?
S = S & “FuncS is “ & FuncS & vbCr ‘
MsgBox S, vbInformation, T ‘ Report progress
‘--- Next line adds to Message line What is
‘ VBAServer.
Func1 ‘ Here?
S = S & “VBAServer.Func1 is “ & VBAServer.Func1 &
vbCr
MsgBox S, vbInformation, T ‘ Report progress
‘--- Next line adds to Message line; this is a
‘better way to refer
‘--- to external functions What is VBAServer.
‘ FuncS Here?
S = S & “VBAServer.FuncS is “ & VBAServer.FuncS
MsgBox S, vbInformation, T ‘ Report progress
End Sub