locked
Embedding an Excel2007 spreadsheet into a WinForm, suggestions? RRS feed

  • Question

  • Hi all.

    We have a C# WinForm application which uses Excel Interop assemblies to embedd an Excel spreadsheet into a form. We need the spreadsheet to be embedded because we need to control which cell the user has selected, so that we can save that value to a database to do some extra cool stuff with it. So basically, the user interacts with Excel from our form.

    Now, we're using the COM component called Microsoft Office Spreadsheet 11, which comes with Office 2003. The application works just fine, and has been doing so in the production environment, which has a Win2003 Server OS and, of course, Excel 2003. All developement PCs have Windows XP, and work perfectly as well.

    Now, we got a requirement to upgrade our application to work in Win7 developement machines (or Win2008 for production) and al least Office 2007, and that's where our problems begin. We have been able to succesfully run the application on Win7 with Excel 2003 (by installing Office 2003 Web Components), with still some issues on 64 bits computers, but we haven't been able to use Excel 2007. For the first part, it seems like Microsoft doesn't offer a Microsoft Office Spreadsheet COM control with Office2007, so we haven't even been able to open the form up in Visual Studio.

    From what I've read, this kind of approach (embedding a spreadsheet into a form) isn't supported any more. If so, what are your suggestions on how I should solve the requirement? Using a WebBrowser control is not an option, cause I really need to be able to "control" what the user is doing in the spreadsheet (at least I need to know where he's standing).

    Any thoughts? How could I solve the issue so that my app can work with Excel 2007?

    Thanks in advance.


    :. HUGONNE .: Please mark as answer if the post helps. Coding tips - http://hugonne.blogspot.com/

    Monday, February 13, 2012 9:22 PM

Answers

  • check this solved thread

    http://stackoverflow.com/questions/605948/questions-about-excel-worksheet-embedding-in-winforms-application

    http://social.msdn.microsoft.com/Forums/en/vsto/thread/c1d99d0c-1300-4e86-a58e-dfe46a3c6ebe

    • Marked as answer by Hugonne Tuesday, February 14, 2012 4:42 PM
    Tuesday, February 14, 2012 6:06 AM

All replies

  • The focus has shifted to WPF I bet.

    http://msdn.microsoft.com/en-us/library/bb772076.aspx

    chanmm


    chanmm

    Tuesday, February 14, 2012 2:38 AM
  • check this solved thread

    http://stackoverflow.com/questions/605948/questions-about-excel-worksheet-embedding-in-winforms-application

    http://social.msdn.microsoft.com/Forums/en/vsto/thread/c1d99d0c-1300-4e86-a58e-dfe46a3c6ebe

    • Marked as answer by Hugonne Tuesday, February 14, 2012 4:42 PM
    Tuesday, February 14, 2012 6:06 AM
  • So it looks like I'm better off by using a third party component. WebBrowser is not an option because I need to do more than just show an Excel file. I'll take a look at SpreadsheetGear to see how it goes.

    Thanks.


    :. HUGONNE .: Please mark as answer if the post helps. Coding tips - http://hugonne.blogspot.com/

    Tuesday, February 14, 2012 4:42 PM
  • You might consider the switch to WPF at this point in time, too.  It could make your application more flexible as it continues to evolve over time.  WinForms is a technology that hasn't seen any changes in several years, not even to fix bugs. 

    http://social.msdn.microsoft.com/Forums/hu-HU/vswpfdesigner/thread/e70358e7-919a-44a4-8b45-73f7ee4f9db4 

    There are 3rd party software packages that claim to be able to do the job.  Most make use of DsoFramer, or only work with older versions of Office. While you are gearing up for 2007, make sure your new solution is ready for Office 2010 or later.  I think the desired approach is to use Visual Studio Tools for Office.

    VSTO: Build Office-Based Solutions Using WPF, WCF, And LINQ  

    Hope this helps.

    Rudy   =8^D


    Mark the best replies as answers. "Fooling computers since 1971."

    http://thesharpercoder.blogspot.com/

    Tuesday, February 14, 2012 7:41 PM