in reply to Excel saving as PDF as 1 page

Can't test this now, but ISTR it should be
$sheet->PageSetup->{FitToPagesWide} = 1; $sheet->PageSetup->{FitToPagesTall} = 1;
Otherwise it's interpreted as method call instead of attribute access.

Replies are listed 'Best First'.
Re^2: Excel saving as PDF as 1 page
by merrymonk (Hermit) on Oct 24, 2015 at 21:34 UTC
    Thank you. This did not give any failure messages.
    Sadly it did not work as the PDF file was written to two pages. Have you any idea how to make it use just one page?
      try
      use Win32::OLE qw(with); use Win32::OLE::Variant; my $vtfalse = Variant(VT_BOOL, 0); my $vtpages = Variant(VT_I4, 1); with ($sheet->PageSetup, 'Zoom' => $vtfalse, 'FitToPagesWide' => $vtpages, 'FitToPagesTall' => $vtpages );
      poj
        Brilliant. That works just as I wanted it to. Thank you for your help. It was good to find it first thing this morning.
        (This is a reply to your latest comment)
        Brilliant. That works just as I wanted it to. Thank you for your help. It was good to find it first thing this morning.