title: Could not convert variant of type (Null) into type (OleStr)
body: <p>Do you know why the block of code bellow will negate the "Could not convert variant of type (Null) into type (OleStr)" on some computers, not all of them but 3 out of ten computers generate the error message.</p>
  
  <p><img src="https://i.stack.imgur.com/r4fyf.jpg" alt="enter image description here"></p>
  
  <pre><code>function GetWMIstringSW(const WMIClass, WMIProperty:string): string;
  
  const
    wbemFlagForwardOnly = $00000020;
  
  var
    FWbemObjectSet: OLEVariant;
    FWbemObject   : OLEVariant;
    oEnum         : IEnumvariant;
    iValue        : LongWord;
    LNode         : TTreeNode;
    LNode2        : TTreeNode;
  
  begin
    Result:='';
    FWbemObjectSet:= FWMIService.ExecQuery(Format('Select %s from %s',[WMIProperty, WMIClass]),'WQL',wbemFlagForwardOnly);
    oEnum         := IUnknown(FWbemObjectSet._NewEnum) as IEnumVariant;
  
    while oEnum.Next(1, FWbemObject, iValue) = 0 do
      begin
        if not VarIsNull(FWbemObject.Properties_.Item(WMIProperty).Value) then
        Result:=FWbemObject.Properties_.Item(WMIProperty).Value;
        LNode := ClientForm.TreeView1.Items.AddChild(Node, Format('%s',[String(FWbemObject.Name)]));
  
        LNode2 := ClientForm.TreeView1.Items.AddChild(LNode, Format('%s',[String(FWbemObject.Version)]));
        FWbemObject:=Unassigned;
      end;
  
  end;
  </code></pre>
  
  <p>The function is then executed at FormCreate:</p>
  
  <pre><code>GETWMIstringSW('Win32_Product','Name');
  </code></pre>
  
  <p>Thank you so much for your help.</p>