BB code in posts seems to be working again!
I haven't turned on every single tag, so please let me know if there are any that are used/needed but not activated.

Main Menu

Embed an Excel Worksheet in VBA form

Started by nessim, October 02, 2008, 01:23:16 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.


Hi guys,

I really searched and tried a lot in order to solve the following problem but did not find a satisfying solution:

The project I am currently working on is a form that should help designing complex shape structures for UI prototyping. In this case it is a "Table Wizard" that lets the user configure the appearance of a table and then generate the corresponding shapes on a page. So far, I used an "Office Web Component (OWC) Spreadsheet" that allows typing in the table cell values and other attributes (Screenshot attached). Everything works fine with this configuration. The problem with OWC is that it is no longer part of Office 2007 and therefore not really an option as most of the endusers will be using Office07. Furthermore, it always triggers an "ActiveX Component" security warning popup when I load the Visio file (it would be OK to click it once if the user actually opens the "TableWizard" form itself).

My idea was to replace OWC with an Excel Spreadsheet object that should be generated and embedded into the form during runtime (that should guarantee version independency) . Unfortunately, there is no such thing as an OLE container object in VBA. I tried a detour using the Web Browser Object as container and then load an Excel file but that is very inconvenient and unstable.
Adding the spreadsheet in design mode is not possible either as there is no object like "Microsoft Office Excel Spreadsheet" (or whatever) available in my "Additional Controls..." toolbox ( I have a reference to "Microsoft Excel 11.0 Object Library").

To sum it up: I'd like to create an Excel (Worksheet) object programatically and then insert it into a form or container of any kind in VBA.

I would very much appreciate any idea!

Thanks in advance,

I attached a screenshot to show what I'm up to. This is my prototype using an OWC spreadsheet.

Browser ID: smf (possibly_robot)
Templates: 4: index (default), Display (default), GenericControls (default), GenericControls (default).
Sub templates: 6: init, html_above, body_above, main, body_below, html_below.
Language files: 4: index+Modifications.english (default), Post.english (default), Editor.english (default), Drafts.english (default).
Style sheets: 4: index.css, attachments.css, jquery.sceditor.css, responsive.css.
Hooks called: 138 (show)
Files included: 34 - 1306KB. (show)
Memory used: 1046KB.
Tokens: post-login.
Cache hits: 13: 0.00200s for 26,766 bytes (show)
Cache misses: 2: (show)
Queries used: 15.

[Show Queries]