http://www.perlmonks.org?node_id=163067


in reply to Win32::OLE and Excel and the Web

I ran your code on my Win2000adv without any problems either. Jmcnamara has the right of it, though. You will need to cast some of the properties as Variants to insure that you will get what you expect, especially the 'Zoom' property in this case.

I'll add an example of variant use like this to my tutorial -- Must have slipped by me.

my $vtfalse = Variant(VT_BOOL, 0); my $vtpages = Variant(VT_I4, 1); with ($Sheet->PageSetup, 'FitToPagesWide'=>$vtpages, 'FitToPagesTall'=>$vtpages, 'Zoom'=>$vtfalse, 'PrintGridlines'=>0, 'LeftHeader'=> "REPORT #DW2009A\rSummary Place of Service", 'CenterHeader' => "Empty", 'RightHeader' => "Test Report", 'LeftFooter' => "Done", 'CenterFooter' => "Now", 'Orientation' => xlLandscape, 'RightFooter' => "OK", 'PrintHeadings'=>0, 'FirstPageNumber'=> xlAutomatic, 'PrintTitleRows' => "1:1");

C-.

Update: Upon further investigation, I found that I *had* include an example of fitting a sheet to one page in the tutorial (including the 'Zoom'), but *hadn't* used VT_I4 types in the FitToPages(Wide|Tall) properties.

Replies are listed 'Best First'.
Re: Re: Win32::OLE and Excel and the Web
by Lando (Initiate) on May 01, 2002 at 18:46 UTC
    Ok, here's me being thickheaded. I want to make sure that you ran that code through a web-server. The code runs fine from the command line -- but it dies going through IIS. If I remove this section, it runs fine. However, on XP, using IIS 5.1, it runs fine. I'll definitely try using the variants, thank you both for your suggestions!
      yup.

      I have an application that does what you asked and then some. I changed some settings in my test environment to match your question, and processed an (.xls) doc COMPLETELY through a web interface.

      C-.

        Crap. I wonder what it is that I'm missing. =( Even the variant changes didn't help. Thanks anyway.