The file you are trying to open, [File_name.xls] is in a different format than specified by the file extension.

Product:

Cognos Controller 10.1.1

Microsoft Excel 2007

Windows 2008 R2 Server

Citrix server

Symptom:

When user run a standard report in Cognos Controller, and select to view the report in Microsoft Excel 2007 ( or Excel 2010) they get a dialog, telling the file content is wrong.

Error message:

“The file you are trying to open, [File_name.xls] is in a different format than specified by the file extension. Verify that the file is not corrupted and is from a trusted source before opening the file. Do you want to open the file now?”  (Yes | No | Help)

 

Solution:

Excel 2007 introduced the concept of Extension Hardening.  Extension Hardening does checks ahead of time to ensure that the file content matches the extension and, if applicable, the MIME type. The upside of Extension Hardening is that it blocks one vector for malformed Excel content attacks, like Trojans. The downside is that it also breaks the classic ASP method of Excel reporting, and the opening of Cognos Controller reports in Excel.

 

There is no granularity in the setting. Extension Hardening cannot be turned off for some websites or content sources, and on for others. It can only be disabled, enabled with a prompt, or enabled with blocking. Extension Hardening can be controlled during installation by the Office Deployment files, or afterwards by group policy or editing the registry.

 

Registry:

[HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Excel\Security]

“ExtensionHardening”=dword:00000000

Possible value settings: Allow different (dword:00000000); Allow different, but warn (dword:00000001); Always match file type (dword:00000002). If the

ExtensionHardening value is not present, Excel defaults to Allow different, but warn.

 

Create a powershell script that is run before the Cognos Controller client program on the citrix server, to set the value off.

This is a example of the script:

Push-Location

If (!(Test-Path “HKCU:\Software\Microsoft\Office\12.0\Excel\Security”))

{

New-Item “HKCU:\Software\Microsoft\Office\12.0\Excel\Security” -force

}

Set-ItemProperty “HKCU:\Software\Microsoft\Office\12.0\Excel\Security” -Name  ExtensionHardening -Value “0” -Type DWORD -force

Pop-Location

 

More information:

http://www.jwgoerlich.us/blogengine/post/2009/08/11/Excel-Extension-Hardening-and-Web-Applications.aspx