Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

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

by devbond (Novice)
on Sep 29, 2013 at 16:00 UTC ( [id://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 (Monsignor) 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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1056236]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (2)
As of 2024-04-26 00:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found