none
Cannot edit OWC in design mode RRS feed

  • Question

  • Hi all,

    I'm quite disappointed to find out that the OWC control cannot be edited in the designer. I need a control that can display tables and also to allow user to enter values in the table (in Windows Forms) and transfer the value into the Excel spreadsheet.

    I was hoping that I can have a look at the initial design. It would be hard to programmatically set values, widths, heights, formula, highlight, etc without a live preview of how it might look during runtime. Surprisingly, Excel's VBA did a good job in this (I'm planning to migrate from VBA to VSTO) because I can directly design the OWC control in the form designer.

    May I know if there are any alternatives to display Excel tables from Windows Forms in VSTO? Datagrid is definitely out of my consideration. I've heard of 3rd party controls that can do just that such as SpreadsheetGear and FarPoint Spread, but I'm very keen to get a free control for this.

    I mean, there has to be a control that can easily display Excel tables within Windows Forms right?

    Thursday, March 8, 2012 3:41 AM

All replies

  • Bump =)
    Monday, March 12, 2012 4:26 AM
  • Hi ycy88,

    Thanks for posting in the MSDN Forum.

    It's based on my experience that you can use DataGrid to display your Excel document. You can use Excel document as a DataSource via ADO and binding it ot DataGrid.

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us

    Monday, March 12, 2012 6:28 AM
    Moderator
  • Hi Tom,

    Thanks for your suggestion. However, I would prefer not to use DataGrid as it has limited functionality and not as flexible as an OWC control (correct me if I'm wrong in this). Furthermore, I'm not familiar with ADO. Perhaps if you could briefly guide me on how to start. I'm using VSTO, by the way =)

    Monday, March 12, 2012 7:05 AM
  • Hi ycy88,

    Would you please tell me you Office version? And  would you tell me your develop environment for further research?

    Have  good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us

    Tuesday, March 13, 2012 6:15 AM
    Moderator
  • Hi ycy88,

    Because with specific information we can all make better responses Tom Xu asked the following :

    Would you please tell me you Office version? And  would you tell me your develop environment for further research?

    Using the OWC Spreadsheet control have you tried specifying the datasource as another Excel workbook/worksheet/range or table?

    Also have you considered using the WebBrowser control to embed an Excel workbook in your application? You can learn more about that from this content:

    How to use the WebBrowser control to open Office documents in Visual C# 2005 or in Visual C# .NET
    http://support.microsoft.com/kb/304662

    Please respond with information about your Office version and your development environment.
    Regards,
    Chris Jensen
    Senior Technical Support Lead

    Chris Jensen

    Friday, March 16, 2012 8:41 PM
    Moderator
  • Hi Tom Xu & cjatms,

    I'm very sorry to take such a long time to follow-up on this issue. I'm using MS Office 2010 and my development environment is VB.net in VSTO. I'm planning to migrate from VBA to VSTO.

    What I'm trying to do is pretty simple. I have an Excel document with tables and I wish to display those tables in a User Form. I'm surprised to find that there is no easy way of doing this. Microsoft did not offer a built-in table control that allows us to extract cell values from the spreadsheet and displaying them to the User Form in tabular form, then allows the user to enter value in the User Form and the value gets passed back to Excel. You may recommend not to use the User Form for this purpose (as I've seen this in other responses), but my spreadsheet contains lots of sheets. User Form provides ease of navigation and I insist on having this done on a User Form. What controls or methods can I use to display tables in User Form? 

    Another quick question: Does OWC control works for end-users running on 64-bit Office (I'm developing this in 32-bit)? I've found out recently that the OWC control in VBA doesnt work for 64-bit Office. That's pretty frustrating.

    Thanks in advance.

    Friday, March 30, 2012 9:45 AM
  • Hi ycy88,

    Taking your questions and comments one by one, as for the many recommendations for not using User Forms the
    comments probably stemmed from the lack of security of VBA. Please see:
    Workbook contains a user form or class module - Excel - Office.com
    http://office.microsoft.com/en-us/excel-help/workbook-contains-a-user-form-or-class-module-HP010014114.aspx

    An article you may already know about, but if you don’t, please see
    How to: Add Controls to a User Form [Excel 2007 Developer Reference]
    http://msdn.microsoft.com/en-us/library/bb211081(v=office.12).aspx

    You asked about other controls to use – you didn’t say which ones you would be
    able to use, so consider the list box, setting its column properties, header
    property, and row source. You’ll have to write code to pass the user’s edits
    back to the Excel table.

    When the control toolbox is visible right-click to see “Additional Controls.”  You’ll see a list of the
    controls that are registered on your system. Click the checkbox to the left of the ones you want in your control toolbox. The Spreadsheet 11 control is available if it’s registered on your system.

    With respect to using OWC for 64-bit Excel, please see the following content where you’ll see that OWC has been deprecated along with the statement that no further development will be made to them – leaving them at the 32-bit level.

    What happened to the Office Web Components? - Joel Oleson's Blog ...
    http://blogs.msdn.com/b/joelo/archive/2007/01/05/what-happened-to-the-office-web-components.aspx

    Regards,
    Chris Jensen
    Senior Technical Support Lead


    Chris Jensen

    Friday, March 30, 2012 8:58 PM
    Moderator
  • Hi Chris,

    Thanks for taking your time to answer my question.

    Yes, I'm aware of that and prepared to assume the security risk associated with the User Form. As mentioned previously, I'll have to insist on using User Forms in my project.

    Prior to using Microsoft Speadsheets 11.0 (OWC) to display tables, I've tried using List Box to display tables from Excel on the User Form. However, it is very inflexible. I need my control to be formatable, enter formula, and functions just like Excel. 

    That leads the question back to my first post. Due to the lack of design support in VSTO, I couldn't set the initial design of my table easily (using MS Spreadsheet). It would be hard to programmatically set values, widths, heights, formula, highlights, etc without a live preview of how it might look during runtime. I need a workaround on this - either force VSTO to have a live preview on Microsoft Spreadsheet 11 just like it does on VBA (if possible), or have another control to display tables on User Form (preferably works on both 32 and 64-bit Office). I find it hard to believe that there is actually no easy way of displaying a table from Excel on the User Form.

    I'm pretty disappointed that the OWC control has been deprecated, leaving no controls to conveniently display tables on User Form (as far as I know). I wouldn't imagine that displaying a table on User Form could be such a pain.

    Saturday, March 31, 2012 4:57 AM
  • Hi all,

    I'm back to provide some additional information. Firstly, correction to the terms used in my previous posts. What I meant by "User Form" is either referring to Windows Forms in VSTO or Userform in VBA. Sorry, I tend to use the term interchangeaby and I'm aware that it might cause some confusion. 

    On the additional information, what I'm trying to do is something like the screenshot below:


    I'm confident now that there exists a control that can display table on Windows Forms. However, I couldn't obtain a decent control that can perform similar function as seen above after weeks of research.

    I haven't do any research on how to display charts from Excel on Windows Forms. Maybe you guys can provide me a rough idea on how to start.

    Appreciate your assistance.

    Monday, April 2, 2012 4:45 AM
  • Hi ycy88
    All told, because of the complexity of your needs your questions fall into the paid support category which requires a more in-depth level of support.  Please visit the below link to see the various paid support options that are available to better meet your needs.

    http://support.microsoft.com/default.aspx?id=fh;en-us;offerprophone

    Regards,
    Chris Jensen
    Senior Technical Support Lead


    Chris Jensen

    Monday, April 2, 2012 9:22 PM
    Moderator
  • Hi Chris,

    Thanks again for your assistance.

    Are you sure that displaying an Excel table on Windows Forms falls under the "complex" category? It means that there exists no control which can perform such simple function on VSTO. If so, I'm really hoping that Microsoft continue with the development of OWC. It really provide great piece of functionality there. I wonder why Microsoft stopped developing OWC, leaving no single solution to display table on the Windows Form. 

    Tuesday, April 3, 2012 4:29 AM
  • Hi,

    Complex refers to all the constraints you put on your issue. No datagrid. OWC can't be edited in design mode. And so forth. Windows Forms designer will let you add many controls to the toolbox, including datagrid, OWC, Chart, and hosts of others. Then you want, not need, a free control. That's another constraint that makes your issue complex. I can't explain why Microsoft stopped developing OWC, but Microsoft Office Spreadsheet 11.0 is among the COM controls you can add to the Toolbox.

    Regards,
    Chris Jensen


    Chris Jensen

    Tuesday, April 3, 2012 1:45 PM
    Moderator
  • Hi Chris,

    Thanks for your response.

    I might be a little confused here. Your statement "I can't explain why Microsoft stopped developing OWC, but Microsoft Office Spreadsheet 11.0 is among the COM controls you can add to the Toolbox" gives me the impression that Microsoft Office Spreadsheet 11.0 is not part of OWC. Please correct me if I misunderstood your statement.

    If there is no other ways, I will have to consider the possibility of using datagrid as the main control to display tables. As far as I understand, datagrid is a control to display databases. Is it possible that I can use this control as a substitute to OWC since the tables that I want to display is not part of a database? It's more like a customized table that look like the picture I attached above (not database in nature). Also, is there a functionality to highlight individual cells within datagrid?

    Last question: Based on your experience, any idea what type of control used in the attachment?

    Thanks, Chris. I appreciate the kind assistance you provided so far.

    Tuesday, April 3, 2012 2:40 PM
  • As you have learned before, OWC 11 is downloadable from Microsoft. The Spreadsheet 11 is one of the 4 components in OWC. Presuming the presence of OWC 11 you can browse to it to add any COM component (of the 4) to the VS toolbox for WinForm applications. OWC is not part of Office 2010. Version 11 is the last one into which Microsoft will make an investment. It won't be part of any future version of a Microsoft product.

    I do not know what control is used in the attachment. The introduction of ActiveX as a set of published standards opened the door to developers to develop, market, and support their own proprietary COM controls for the Windows platform.  The control in the attachment may be one of those. Perhaps another Forum browser will see the attachment and respond to your question. It could be the Office Chart Control. Some information about that control is contained in the following:

    828411 You cannot use the MSODSC control when you insert an Office Chart 11.0 control in a data access page
    http://support.microsoft.com/default.aspx?scid=kb;EN-US;828411

    - Web Components and Controls
    http://msdn.microsoft.com/en-us/library/aa165059(v=office.10).aspx

    - The Office Web Components: Charts - Support - Office.com
    http://office.microsoft.com/en-us/help/the-office-web-components-charts-HA001055021.aspx

    - The Office Web Components: Spreadsheets - Support - Office.com
    http://office.microsoft.com/en-us/help/the-office-web-components-spreadsheets-HA001055020.aspx

    - The Office Web Components Add Analysis Tools to Your Web Page ...
    http://office.microsoft.com/en-us/help/the-office-web-components-add-analysis-tools-to-your-web-page-HA001055018.aspx


    Chris Jensen

    Wednesday, April 4, 2012 1:44 PM
    Moderator