in reply to Troubles transposing a range in Excel with Win32::OLE


It looks like "Transpose" requires a Variant agrument. The following works for me:
use Win32::OLE::Variant; # ... $worksheet->Cells(10,5)->PasteSpecial( { Paste => xlAll, Operation => xlNone, SkipBlanks => 0, Transpose => Variant(VT_BOOL, 'True') });

--
John.

Replies are listed 'Best First'.
Re: Re: Troubles transposing a range in Excel with Win32::OLE
by guha (Priest) on Jan 10, 2002 at 14:10 UTC

    Problem Solved

    Should this be considered a bug in OLE ?
    Knowing that c-era could replicate the problem in VB, why was there no refs of this found in google ?
    Is Transpose such a rare creature or is it just me ??

    Kudos to jmcnamara and c-era!

    Thanks2


      I don't think that this is a bug.

      However, it is often hard to match Perl's variable types with those expected by VBA. That is why the Win32::OLE::Variant module is so useful.

      A good resource for Win32::OLE related information is the ActiveState mailing lists. In particular the perl-win32-users list. Jan Dubois, the author of Win32::OLE, often answers questions there.

      As an aside, Win32::OLE is an extremely powerful module and potentially very useful. However, it is let down by a lack of comprehensive documentation and examples.

      --
      John.