Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

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

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


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

Thanks...i found out what the problem is...i was not declaring wrokbook as type my(local).Can you try running you code after removing my it woudnt work..i dont understand why
  • Comment on Re^2: Not able to create worksheets inside a subroutine

Replies are listed 'Best First'.
Re^3: Not able to create worksheets inside a subroutine
by hdb (Prior) on Sep 29, 2013 at 16:04 UTC

    No, removing my is not the way to go at all. Always use strict;, clear away all errors and then see what happens.

      I cant declare workbook as my as i need to use it in other subs too

        Then, at least, declare it as a globel variable, ie outside of all subs. Or, better, pass it as a parameter into the subs, that need it.

Re^3: Not able to create worksheets inside a subroutine
by ig (Vicar) on Sep 30, 2013 at 07:15 UTC

    Spreadsheet::WriteExcel tries to close your workbook automatically but sometimes has problems "If the new(), add_worksheet() or add_format() methods are called in subroutines." You can read the section on the close() method for more detail on limitations of automatic closing.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1056236]
help
Chatterbox?
[Corion]: marto: Yeah - their mother picked all three of them up at the kindergarden to then go to the hospital, and all three of them were well behaved, and all also were quite obedient when they came home, so they recognized the situation
[Corion]: Nice to see that the kids have some understanding of important things that happen and the appropriate behaviour :)

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (8)
As of 2016-12-08 09:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (137 votes). Check out past polls.