-
Actually I just tried running Environ("Computername") in Excel, on both servers, and the SAS Server Excel returns a string containg SAS inside this variable e.g. it returns a string of the form "***-SAS-YYY"
So I gues the "Checking"Part could simply be function like:
[vba]
Function IsSASServer() As Boolean
On Error GoTo IsSASServer_Error
IsSASServer = False
If InStr(1, Environ("Computername"), "SAS", vbTextCompare) > 0 Then
IsSASServer = True
End If
On Error GoTo 0
Exit Function
IsSASServer_Error:
MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure IsSASServer"
End Function
[/vba]
Q1: What you think about the above logic i.e. do you feel it is robust? Although it seems to work, is there a more rigorous way to check?
Q2: Also how could the structure of the above code and error-handling be improved.
Thanks for your help.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules