Hello,
I am trying to return the amount of packets my wireless NIC has transmitted using VB6 and WMI. Here is my effort:
The result is that the For Each line will trigger an Automation Error without the bail GoTo clause. Any help?
thanks in advance
I am trying to return the amount of packets my wireless NIC has transmitted using VB6 and WMI. Here is my effort:
Code:
Set WMIClass = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\wmi")
Set WMIObj = WMIClass.ExecQuery("SELECT * FROM MSNdis_80211_Statistics WHERE Active=True")
'
On Error GoTo bail
For Each tmp In WMIObj
frmMain.MSFlexGrid1.TextMatrix(7, 1) = tmp.TransmittedFragmentCount
Exit Sub
Next
'
bail:
frmMain.MSFlexGrid1.TextMatrix(7, 1) = "error"
The result is that the For Each line will trigger an Automation Error without the bail GoTo clause. Any help?
thanks in advance