- Код: Выделить всё
Dim servise As WbemScripting.SWbemServices
Dim ObjectSet As WbemScripting.SWbemObjectSet
Dim Sobject As WbemScripting.SWbemObject
Dim PropSet As WbemScripting.SWbemPropertySet
Dim SProp As WbemScripting.SWbemProperty
Dim WbemLocator1 As WbemScripting.SWbemLocator
Set servise = WbemLocator1.ConnectServer(".", "root\CIMV2", "", "", "", "", 0, Nothing)
Set Sobject = servise.Get("Win32_Battery", wbemFlagUseAmendedQualifiers, Nothing)
Set ObjectSet = Sobject.Instances_(0, Nothing)
В строке : Set servise =..... ошибка. 'Object Variable or With block variable not set!'