limitation(s) on adding worksheet to existing workbook

18 views
Skip to first unread message

Phillip Richcreek

unread,
Jun 11, 2015, 6:02:54 PM6/11/15
to spreadsheet...@googlegroups.com
My (two) questions refer to "FAQ: How do I update an existing Excel file",

1. The FAQ states 
..."However, you can only rewrite the features that Spreadsheet::WriteExcel
supports so macros, graphs and some other features in the original
Excel file will be lost. Also, currently, formulas aren't copied."


Does this caveat, in particular the part about formulas, still apply in the current version?


2. The example includes:

 # The SaveParser SaveAs() method returns a reference to a
    # Spreadsheet::WriteExcel object. If you wish you can then
    # use this to access any of the methods that aren't
    # available from the SaveParser object. If you don't need
    # to do this just use SaveAs().
    #
    my $workbook;

    {
        # SaveAs generates a lot of harmless warnings about unset
        # Worksheet properties. You can ignore them if you wish.
        local $^W = 0;

        # Rewrite the file or save as a new file
        $workbook = $template->SaveAs('new.xls');
  }

 I don't understand the comment, "just use SaveAs()" Does it mean to use:
$workbook = $template->SaveAs('the-name-of-the-file-i-am-rewriting'); ?

TIA, Phil



jmcnamara

unread,
Jun 12, 2015, 9:43:59 AM6/12/15
to spreadsheet...@googlegroups.com, pwric...@gmail.com


On Thursday, 11 June 2015 23:02:54 UTC+1, Phillip Richcreek wrote:
My (two) questions refer to "FAQ: How do I update an existing Excel file",

1. The FAQ states 
..."However, you can only rewrite the features that Spreadsheet::WriteExcel
supports so macros, graphs and some other features in the original
Excel file will be lost. Also, currently, formulas aren't copied."


Does this caveat, in particular the part about formulas, still apply in the current version?

Hi,

Yes. This still applies.

 


2. The example includes:

 # The SaveParser SaveAs() method returns a reference to a
    # Spreadsheet::WriteExcel object. If you wish you can then
    # use this to access any of the methods that aren't
    # available from the SaveParser object. If you don't need
    # to do this just use SaveAs().
...
 
        # Rewrite the file or save as a new file
        $workbook = $template->SaveAs('new.xls');

 I don't understand the comment, "just use SaveAs()" Does it mean to use:
$workbook = $template->SaveAs('the-name-of-the-file-i-am-rewriting'); ?

I just means that if you don't want to access the S::WE object then you can just ignore the return value and do this:

    $template->SaveAs('new.xls');

John

Reply all
Reply to author
Forward
0 new messages