I am trying to display the Excel document in windows forms using the webbrowser Control.
using the code googled in Codeproject How to Integrate Excel in a Windows Form Application using the WebBrowser
] and i am able to disaply excel(.xls and .xlsx) files in 32 bit Operating System correctly in webbrowser control.
But when i trying to execute the code in 64-bit operating system .xlsx type Excel files didn't open in webbrowser Control instead they were opening as normal excel file but .xls files opening correctly in webbrowser Control.
For that i executed the register Script to change the registry settings using the below link http://support.microsoft.com/kb/927009
but .xlsx files always Open separately as like Office excel file instead of opening it in webbrowser Controls.
Presently i am using Microsoft Office 2010 software as my office tool.
Please provide the solution to open the .xlsx files to be open in webbrowser control.
If you have 32 bit office installed in a 64 bit OS, you must compile your winforms application as "x86" not "AnyCPU". If it is compiled as "AnyCPU" it will start the 64 bit CLR which cannot host 32 bit office interop dlls.
The older xls format was supported by the Jet engine, which has side by side support for both 64 and 32 bit, the newer xlsx format is supported by a newer engine that does have side by side support. This is a major pain in the neck, but the information about 64 bit support was directly from Microsoft support - they nmo longer intend to provide side by side support, as the see the file support as part of office, not part of the OS. Fortunately, few people install 64 bit office, even on a 64 bit OS, so compiling for x86 will work with 32 bit office on either OS. If you have to support both 32 bit office, and 64 bit office, you will need two versions (one AnyCPU or x64 and one x86), and will need to determine which office version you are interacting with at install time.
Edited 19-Jan-13 8:52am
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)