Thank youI tried you suggestion but got the following error on the failing PC
Perl v5.28.0
Win32::OLE Version 0.1712
Win32::OLE(0.1712) error 0x800401f3: "Invalid class string" at line with my $excel = Win32::OLE->new('Excel.Application')
or die Win32::OLE->LastError();
However on the PC where the test works, you suggestion also works.The Perl version and Win32:OLE version were the same on both PCs.
Have you any idea why the systems are giving different results?