Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: OLE and Excel question

by Sandy (Deacon)
on May 05, 2009 at 21:28 UTC ( #762084=note: print w/ replies, xml ) Need Help??


in reply to OLE and Excel question

for your first question

Sometimes it really helps to run the Excel macros and see what that gives you

Range("B2").Select ActiveWindow.FreezePanes = True
This (translated to perl) works for me
my $freeze_panes = $gExcel->ActiveSheet->Range("B2")->Select; #$gSheet->Cells(2,2)->Select(); $gExcel->ActiveWindow->{FreezePanes} = 1;
I changed ActiveSheet to ActiveWindow

and set the selection to a single cell (instead of a row). If set to a row (2:2) it still works by freezing only the top row.


Comment on Re: OLE and Excel question
Select or Download Code
Re^2: OLE and Excel question
by Nkuvu (Priest) on May 05, 2009 at 21:48 UTC

    My general approach is (very) slightly different:

    # The number of rows above the split: $Excel->ActiveWindow->{SplitRow} = 1; $Excel->ActiveWindow->{FreezePanes} = 1;

    No selection or intermediate variable necessary ($freeze_panes -- used somewhere else in the code?).

    In regards to the second question, are you (by "you" I mean gibsonca) calling $Excel->Quit() when you're done with Excel? Also note that I've found that if my script terminates early, the application isn't always killed properly.

Re^2: OLE and Excel question
by gibsonca (Beadle) on May 06, 2009 at 21:55 UTC
    Thanks. Your suggestion worked and my problem solved.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (9)
As of 2014-08-23 17:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (176 votes), past polls