Hi all,
I'm getting the unsual error message [See attached] but only on one machine (Win7 x64).
Code:
Function printerExists(str) As Boolean
printerExists = False
Dim objWMIService
Set objWMIService = GetObject("winmgmts:\\.\root\cimv2")
Dim colPrinters
Set colPrinters = objWMIService.ExecQuery("Select * From Win32_Printer") <---- FAILS HERE *****************
Dim objPrinter
For Each objPrinter In colPrinters
If objPrinter.Name = str Then
printerExists = True
Exit For
End If
Next
PrterChkd = True
End Function
Any ideas on a solution would be appreciated.
Regards,
Eddie