note
Corion
<p>As always, you do this by using [cpan://Win32::OLE] to automate Excel.</p>
<p>The steps are the usual six steps:</p>
<ol>
<li>Start the Excel Macro Recorder</li>
<li>Perform the desired action(s) manually, in your case, save the file as XML</li>
<li>Stop the Excel Macro Recorder</li>
<li>Inspect the generated VB code</li>
<li>Check that the generated VB code does what you want</li>
<li>Translate the generated VB code to Perl / Win32::OLE invocations</li>
</ol>
<p>There are many examples on this website which should give you a good start on how to do the translation. It consists mostly of <code>s!\.!->!</code> applied to every line of the code, and you will have to exchange the global properties like "ActiveWorkSheet" by the local values you get from <code>$excel->OpenFile()</code>.</p>
497331
497504