I am having trouble saving an Excel spreadsheet.
I copied the code from application to another.
I also copied the way the template spreadsheet is accessed.
I use this to give standard cell headings etc.
In the first application I do not have any problems at all.
In the second application I get a Microsoft Excel diagnostic box that says
Do you want to save the changes you made to spreadsheet_file_name.
If I say yes, the spreadsheet is saved as I want it to be.
However I do not want my user to have to do that!
The code extract is below:
$excel->{DisplayAlerts}=0; $excel_res = 1; $excel->Workbooks(1)->SaveAs($new_spreadsheet) or ($excel_res = 0, $e +w_message = "Could not save spreadsheet"); $en_num = Win32::GetLastError(); $en_err = "message <" . Win32::FormatMessage($en_num) . "> number <" . + $en_num . ">"; $ew_message = "<" . $ew_message . "> is just after saving part file\n" + . "system error text <$en_err>\n"; print "$ew_message\n"; $excel->{DisplayAlerts}=1;
The print gives me

<Could not save spreadsheet> is just after saving part file system error text <message <> number <317>>

Has any monk, wiser than I, a clue as to what is going wrong?

In reply to Spreadsheet Saving Error by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.