Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^2: How do I print the page header/footer from an excel spreadsheet

by friedo (Prior)
on Nov 08, 2006 at 18:50 UTC ( #582948=note: print w/ replies, xml ) Need Help??


in reply to Re: How do I print the page header/footer from an excel spreadsheet
in thread How di I print the page header/footer from an excel spreadsheet

++ to the first person to show me how to eliminate $item - I feel like it is unnecessary.
$Sheet->PageSetup->${ \"$element$position" };


Comment on Re^2: How do I print the page header/footer from an excel spreadsheet
Select or Download Code
Re^3: How do I print the page header/footer from an excel spreadsheet
by bmann (Priest) on Nov 08, 2006 at 18:54 UTC
    You can use the "hash syntax" to access object properties (see Win32::OLE documentation)Properties of an object are implemented as a hashref, so more simply:

    $Sheet->PageSetup->{"$element$position"} # or $Sheet->PageSetup->{$element . $position}
    Update: pr
      Not all objects work that way under the hood, though. It's bad practice to access the hash data directly. (Though it's probably not very good practice to use arcane syntax for dynamic method names either!)
        Not sure if you replied before the update, but why is it bad practice? I know some properties can't be set that way, but what problems do avoid by not using the hash syntax?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://582948]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (6)
As of 2014-08-01 06:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (257 votes), past polls