Embeding an office document in a c# app

D

dan.neely

I need to embed excel functionality into my app, but can't find a
complete solution. The article below shows how to embed it as activeX
in a browser control, but the control doesn't support bringing excels
menus into the program. Is there annother approach that would allow
more complete functionality out of the box, or is it possible to hack
the menu support into the browser control and how much effort would it
involve?

http://support.microsoft.com/default.aspx?scid=kb;en-us;304662
 
D

Dmytro Lapshyn [MVP]

Hi,

The first thing I'd try is to create a COM interop library and a wrapper
AxHost-based control for the Excel embeddable object by using the tlbimp.exe
and aximp.exe command line tools.
Then, I'd add the wrapper control to a Windows form having the main menu and
activate the object. Hopefully .NET implements a full-blown OLE container
and can properly handle OLE menu merging - in this case, the Excel menus
should be merged to the main menu of the form.

Otherwise, I'm arfaid you will need too much hacking to implement all
required OLE support.
 
G

Guest

Dmytro Lapshyn said:
The first thing I'd try is to create a COM interop library and a wrapper
AxHost-based control for the Excel embeddable object by using the tlbimp.exe
and aximp.exe command line tools.
Then, I'd add the wrapper control to a Windows form having the main menu and
activate the object. Hopefully .NET implements a full-blown OLE container
and can properly handle OLE menu merging - in this case, the Excel menus
should be merged to the main menu of the form.

I've never done any COM programming before, so I don't really know where to
begin, or how long it would require. If it would be a fairly major
undertaking we might end up kludging it by just starting excel in a seperate
process.
 
G

Guest

Dmytro Lapshyn said:
The first thing I'd try is to create a COM interop library and a wrapper
AxHost-based control for the Excel embeddable object by using the tlbimp.exe
and aximp.exe command line tools.
Then, I'd add the wrapper control to a Windows form having the main menu and
activate the object. Hopefully .NET implements a full-blown OLE container
and can properly handle OLE menu merging - in this case, the Excel menus
should be merged to the main menu of the form.

I'm not sure if this's related to what you meant, but I tried going
through Tools-Add/Remove ToolboxItems-Com Components, and added a MS
Spreadsheet(v11) control to my project.. IT didn't do a menu merge, and came
with a fixed and very limited toolbar, making it a poorer solution than
activexing through the webcontrol.
 
A

Alvin Bruney [MVP - ASP.NET]

See the Office Web Components for the web or VSTO for desktop applications.
These two provide all the automation you will ever require.

--
Regards,
Alvin Bruney - ASP.NET MVP

[Shameless Author Plug]
The Microsoft Office Web Components Black Book with .NET
Now available @ www.lulu.com/owc, Amazon.com etc
 
G

Guest

Alvin Bruney said:
See the Office Web Components for the web or VSTO for desktop applications.
These two provide all the automation you will ever require.

Automation is planB, a fully functional control that could be embedded into
the c# app is the solution we're hoping to be able to implement.

------------------------------------------------------------
|My Winform app |
------------------------------------------------------------
|Menubar - my menus + excel Menus (if on tab with SS |
------------------------------------------------------------
| |
| ----------------------------------------------------- |
| |winform tab 1 | winform tab 2| TAB WITH EMBEDDED SS | |
| ------------------------------------------------------ |
| | | |
| | ---------------------------------------------- | |
| | |Excel control with toolbars, populated with | | |
| | |data from a db | | |
| | | | | |
| | ---------------------------------------------- | |
| | | |
| | Other Controls..... | |
| | | |
| ------------------------------------------------------ |
| |
| Other Controls..... |
------------------------------------------------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top