Excel 2003 XML格式不会自动在excel2010 x64中打开。

时间:2023-01-15 10:37:14

I've got a vbscript which generates Excel files, in the old-style Excel XML Spreadsheet 2003 format. It contains the necessary processing instructions (i.e. the <?mso-application progid="Excel.Sheet"?> tag) and my users are able to open them in Office 2003 and Office 2007 (running on XP), by double-clicking the attachment.

我有一个vbscript,它以旧式的Excel XML电子表格2003格式生成Excel文件。它包含必要的处理指令(即

We are now testing a desktop build of Windows 7 x64 with Office 2010 x64 and this no longer works. The files just open in IE and show the underlying XML. If the file is saved to the desktop, it still shows the Excel emblem on the icon, but will still open in IE.

我们现在正在测试Windows 7 x64和Office 2010 x64的桌面版本,这个版本已经不能用了。这些文件只是在IE中打开并显示底层的XML。如果文件保存到桌面,它仍然会在图标上显示Excel图标,但是仍然会在IE中打开。

Is this a 64-bit issue or an Excel 2010 issue? Is there a fix? I'm thinking a persistent handler might be missing or mis-registered in the Registry, but I don't know what to add instead...

这是64位问题还是Excel 2010问题?有解决吗?我在想一个持久处理程序可能在注册表中丢失或注册错误,但是我不知道应该添加什么……

1 个解决方案

#1


0  

A few thoughts:

几个想法:

Perhaps you need to specify the Content Header tag as well? This PHP code creates and opens an XML file in Excel 2016 for me:

也许您还需要指定内容头标记?这段PHP代码为我在Excel 2016中创建并打开了一个XML文件:

<?php
    header('Response.ContentType = "application/vnd.ms-excel"');
    header('Content-Disposition: attachement; filename="xlxml.xml"');
    echo '<root><name>sample_name</name></root>';
    exit();
?>

This VBS demonstration generated an Excel file which opened properly in Excel 2016 for me.

这个VBS演示生成了一个Excel文件,它在Excel 2016中为我打开了。

A couple other links with some related insight:

其他与一些相关见解的联系:

Generating Excel (XML Spreadsheet) & Excel header functions

生成Excel (XML电子表格)和Excel头函数。

Content-type for MS Office XML

MS Office XML的内容类型

XML Schema Guidelines

XML模式的指导方针

Content Disposition

内容处理

#1


0  

A few thoughts:

几个想法:

Perhaps you need to specify the Content Header tag as well? This PHP code creates and opens an XML file in Excel 2016 for me:

也许您还需要指定内容头标记?这段PHP代码为我在Excel 2016中创建并打开了一个XML文件:

<?php
    header('Response.ContentType = "application/vnd.ms-excel"');
    header('Content-Disposition: attachement; filename="xlxml.xml"');
    echo '<root><name>sample_name</name></root>';
    exit();
?>

This VBS demonstration generated an Excel file which opened properly in Excel 2016 for me.

这个VBS演示生成了一个Excel文件,它在Excel 2016中为我打开了。

A couple other links with some related insight:

其他与一些相关见解的联系:

Generating Excel (XML Spreadsheet) & Excel header functions

生成Excel (XML电子表格)和Excel头函数。

Content-type for MS Office XML

MS Office XML的内容类型

XML Schema Guidelines

XML模式的指导方针

Content Disposition

内容处理