FAQ: Why does my Spreadsheet::WriteExcel not load correctly in Excel.

11 views
Skip to first unread message

Peter Bocz

unread,
Oct 21, 2009, 10:20:04 AM10/21/09
to Spreadsheet::WriteExcel
Hi

Using Spreadsheet::WriteExcelXML I managed to generate a simple file
that fails to load in Excel 2003 and 2007.
The xml file below contains a single cell value "http://cpan org"
intentionally replacing '.' with space.
The write() method detects it as a URL and write_url() is called
resulting in this xml output.
The problem with Excel is it does not give you any useful information
on the source of error, just complains that it failed to load the
file. In case of a huge file with thousands of rows it's really a
problem.
On the other hand, Spreadsheet::WriteExcelXML may put only "http://
cpan" in the HRef field by using more strict pattern matching to
provide valid URLs to Excel to workaround this problem.

Regards,
Peter

<?xml version="1.0"?>
<?mso-application progid="Excel.Sheet"?>
<Workbook xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet">
<Worksheet ss:Name="Excel Test">
<Table>
<Row>
<Cell ss:HRef="http://cpan org">
<Data ss:Type="String">http://cpan org</Data>
</Cell>
</Row>
</Table>
</Worksheet>
</Workbook>

jmcnamara

unread,
Oct 31, 2009, 1:56:52 AM10/31/09
to Spreadsheet::WriteExcel

On Oct 21, 2:20 pm, Peter Bocz <boczpe...@gmail.com> wrote:
> Hi
>
> Using Spreadsheet::WriteExcelXML I managed to generate a simple file
> that fails to load in Excel 2003 and 2007.
> The xml file below contains a single cell value "http://cpanorg"
> intentionally replacing '.' with space.

Hi Peter,

Try using %20 instead of space to see if it helps.


John.
--
Reply all
Reply to author
Forward
0 new messages