I'm occasionally getting an error in a Delphi 7 program.

Exception EOIeException in module [my project name].exe at 000AA1EE. class not registered.

This error happens in a function I have that looks up the Windows serial number of the user's machine (below). This only seems to happen on a few specific machines. Are there any reasons why this would cause this error on some machines and not others? I've seen it not throw the error on 64bit machines and on all Windows versions from XP to Windows 8.

Code:
uses
  ActiveX, ComObj;
 
function GetWin32_OSSerial : string;
var
  objWMIService : OLEVariant;
  colItems      : OLEVariant;
  colItem       : OLEVariant;
  oEnum         : IEnumvariant;
  iValue        : LongWord;
 
  function GetWMIObject(const objectName: String): IDispatch;
  var
    chEaten: Integer;
    BindCtx: IBindCtx;
    Moniker: IMoniker;
  begin
    OleCheck(CreateBindCtx(0, bindCtx));
    OleCheck(MkParseDisplayName(BindCtx, StringToOleStr(objectName), chEaten, Moniker));
    OleCheck(Moniker.BindToObject(BindCtx, nil, IDispatch, Result));
  end;
 
begin
  objWMIService := GetWMIObject('winmgmts:\\localhost\root\cimv2');
  colItems      := objWMIService.ExecQuery('SELECT SerialNumber FROM Win32_OperatingSystem','WQL',0);
  oEnum         := IUnknown(colItems._NewEnum) as IEnumVariant;
  if oEnum.Next(1, colItem, iValue) = 0 then
  Result:=colItem.SerialNumber;
end;
 
initialization
  OleInitialize(nil);
 
finalization
  OleUninitialize;