使用Office 2007/2010打开.xls文件时获取扩展检查(强化)警报 [英] Getting extension check(hardening) alert while opening a .xls file using Office 2007/2010

查看:157
本文介绍了使用Office 2007/2010打开.xls文件时获取扩展检查(强化)警报的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发基于struts的Web应用程序。在该应用程序中,我们从Jsp生成并下载xls文件。
在Jsp文件和web.xml中,我将内容类型设置为application / vnd.ms-excel

I am working on a struts based web application. In that application, we generate and download xls file from Jsp. In Jsp file and web.xml, I have set the content-type as "application/vnd.ms-excel"

似乎生成的xls文件jsp页面不是真正的excel文件,而是MS Excel理解的文本格式。因此,excel打开文件并显示类似于MS Excel保存的excel文件的输出。由于较新版本的MS Office 2007/2010会检查文件扩展名和文件内的内容,因此会发出警告,指出文件格式与内容不匹配。

it seems xls files generated by the jsp pages are not real excel files, but a text format that is understood by the MS Excel. Hence excel opens the files and displays the output similar to excel files saved by MS Excel. Since newer versions of MS Office 2007/2010 checks the file extension and the content inside the file, they issue a warning that the file format does not match with the content.

要摆脱警告,我怎样才能确保生成的xls是真正的办公室excel文件。

To get rid of the warning how can i ensure that the generated xls is real office excel file .

请帮助。

推荐答案

对于未来可能需要此读者的读者...
Excel无论如何都会抱怨,即使你的excel文件是正确的,只要其结构与扩展名不匹配即可。因此,如果您保存为.XLS,它希望看到经典的Excel文件。
您获得的弹出窗口是因为Office 2007中的新安全功能,称为扩展加固,您可以根据需要禁用它 - 可以在注册表中手动删除,也可以将修补程序保存到.REG文件中分享给您的客户等。

For future readers who might need this... Excel will complain anyway, even if your excel file is 'correct', as long as its structure doesn't properly match the extension. So if you're saving as an .XLS, it expects to see the classic excel file. The popup you are getting is because of the new security feature in Office 2007, called Extension Hardening and you can disable it if you want - either manually in the registry, or you can save the patch to a .REG file and share it to you clients etc.

将下面的2行保存到GiveItSomeName.reg文件中,然后您可以通过电子邮件发送给您的客户并告诉他们执行它。 / p>

Save those 2 line below into a GiveItSomeName.reg file, which you can then email to your clients and tell them to execute it.

[HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Excel\Security]
"ExtensionHardening"=dword:00000000

这篇关于使用Office 2007/2010打开.xls文件时获取扩展检查(强化)警报的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆