Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^6: Not able to create worksheets inside a subroutine

by devbond (Novice)
on Sep 29, 2013 at 18:02 UTC ( #1056246=note: print w/replies, xml ) Need Help??


in reply to Re^5: Not able to create worksheets inside a subroutine
in thread Not able to create worksheets inside a subroutine

#!/usr/bin/perl use warnings; use Spreadsheet::WriteExcel; use Spreadsheet::ParseExcel; use Spreadsheet::ParseExcel::SaveParser; my $workbook; my @s; $Month=Sept; sub create_excel { $workbook = Spreadsheet::WriteExcel->new('FAISTATS_'."$Month".'.xls'); for ( $i=1;$i<=8;$i++) { $s[$i] = $workbook->add_worksheet( "cpzea0".$i."a0001" ) ; } $s[9] = $workbook->add_worksheet( "WEEKLY" ) ; $s[10] = $workbook->add_worksheet( "MONTHLY" ) ; } create_excel();
declaring workbook outside is not working

Replies are listed 'Best First'.
Re^7: Not able to create worksheets inside a subroutine
by poj (Prior) on Sep 29, 2013 at 18:24 UTC
    Try adding $workbook->close() as last statement.
    poj
Re^7: Not able to create worksheets inside a subroutine
by Anonymous Monk on Sep 29, 2013 at 18:18 UTC
    What does not work?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1056246]
help
Chatterbox?
[erix]: oh well, it's holy week, right? Thick-skin week. I just read that in the Philippines, some RCs practice self-crucifixion. Tough cookies I'd like to see
[LanX]: already?
[erix]: I don't know really. I thought so.
[LanX]: April 16th
[erix]: ah no, 16 april. some time to go yet :)
[LanX]: I hate resurrection ... my back aches
erix practices self-crucifixion but keeps getting get stuck at the one loose hand stage...
LanX has seen this in action ... pope should claim copyright infringement
[LanX]: dunno how to link image search

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (12)
As of 2017-03-23 09:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (285 votes). Check out past polls.