ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel Functoin getting Cluster status (https://www.excelbanter.com/excel-programming/308382-excel-functoin-getting-cluster-status.html)

Steven

Excel Functoin getting Cluster status
 
I try to implement a Excel Function for getting the status of the groups
and so on. Here is my initial script. It doesn't work, when I try to try
to enter the formula "=Querycluster(nodename,"groups")". Any ideas
what's wrong.

+++

Public Function Querycluster(Node As String, Resource As String) As Variant

Dim objCluster As Object

Set objCluster = CreateObject("MSCluster.Cluster")

objCluster.
If objCluster Is Nothing Then
Querycluster = CVErr(2001)
Exit Function

End If
Select Case LCase(Resource)

Case "groups"
Querycluster = objCluster.ResourceGroups
Case Else
Querycluster = CVErr(2001)
End Select


End Function

Tom Ogilvy

Excel Functoin getting Cluster status
 
Even though you don't appear to use nodename, you would need to supply a
string in that position

=Querycluster("nodename","groups")

--
Regards,
Tom Ogilvy

"Steven" wrote in message
...
I try to implement a Excel Function for getting the status of the groups
and so on. Here is my initial script. It doesn't work, when I try to try
to enter the formula "=Querycluster(nodename,"groups")". Any ideas
what's wrong.

+++

Public Function Querycluster(Node As String, Resource As String) As

Variant

Dim objCluster As Object

Set objCluster = CreateObject("MSCluster.Cluster")

objCluster.
If objCluster Is Nothing Then
Querycluster = CVErr(2001)
Exit Function

End If
Select Case LCase(Resource)

Case "groups"
Querycluster = objCluster.ResourceGroups
Case Else
Querycluster = CVErr(2001)
End Select


End Function




Steven

Excel Functoin getting Cluster status
 
Tom Ogilvy wrote:
Even though you don't appear to use nodename, you would need to supply a
string in that position

=Querycluster("nodename","groups")

You mean

Putting in Cell =Querycluster("<nodename","groups")

Script looks this (changes here )

Public Function Querycluster(Nodename As String, Resource As String) As
Variant

Dim objCluster As Object

Set objCluster = CreateObject("MSCluster.Cluster")
objCluster.Open Nodename

If objCluster Is Nothing Then
Querycluster = CVErr(2001)
Exit Function

End If
Select Case LCase(Resource)

Case "groups"
Querycluster = objCluster.ResourceGroups
Case Else
Querycluster = CVErr(2001)
End Select


End Function



All times are GMT +1. The time now is 01:09 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com