my $sa = Win32::OLE->new("SiebelDataServer.ApplicationObject") or die "failed"; $rcref = Variant(VT_I2|VT_BYREF, 0); $sa->LoadObjects($cfg, $rcref); x("a", $rcref); sub x { my ($tag, $rc) = @_; warn("[$tag] " . $sa->GetLastErrText()) unless $rc == 0) }