Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
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?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2016-09-28 21:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Extraterrestrials haven't visited the Earth yet because:







    Results (540 votes). Check out past polls.