473,408 Members | 2,888 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Embeding an office document in a c# app

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...b;en-us;304662

Nov 17 '05 #1
5 3601
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.

--
Sincerely,
Dmytro Lapshyn [Visual Developer - Visual C# MVP]
<da*******@gmail.com> wrote in message
news:11********************@f14g2000cwb.googlegrou ps.com...
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...b;en-us;304662


Nov 17 '05 #2


"Dmytro Lapshyn [MVP]" wrote:
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.
Nov 17 '05 #3
"Dmytro Lapshyn [MVP]" wrote:
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.
Nov 17 '05 #4
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
"Dan Neely" <Dan Ne***@discussions.microsoft.com> wrote in message
news:F3**********************************@microsof t.com...
"Dmytro Lapshyn [MVP]" wrote:
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.

Nov 17 '05 #5


"Alvin Bruney [MVP - ASP.NET]" wrote:
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..... |
------------------------------------------------------------
Nov 17 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Sascha Kerschhofer | last post by:
Hi, I am embeding my SVG Files in HTML in this way: <OBJECT DATA="foo.svg" WIDTH="300" HEIGHT="200" TYPE="image/svg+xml"> (using Acrobat SVG Viewer) Since I create the SVG dynamicaly the WIDTH...
1
by: Piotrek W | last post by:
Hi, Little problem... How to write some text into current document at text coursor position? Peter
7
by: scorpion53061 | last post by:
Has anyone done automation with Office 2003 with vb.net? How did it go(esp Word, Excel, Access)? Any problems I should be aware of? I am getting my copy next week so I thought I should do some...
0
by: Karel | last post by:
Hi, I have developed a vb.net application to create a mail-merged document by using Automation to word from VB.NET. I added the following reference to the application: Microsoft Office 10.0...
2
by: William LaMartin | last post by:
I have created a program that allows for the automation of things in Word documents, like changing the values of DocVariables and the links to Excel Sheets. I did it using interoperoperatability,...
1
by: BK | last post by:
I have a .NET Solution (currently in 2003, FW 1.1) that uses Office automation for a few things (generates a Word document, dumps datagrids to Excel, etc.). One of my programmers works on the...
4
by: amphibian1 | last post by:
I'm trying to write a C# application that iterates through a collection of Microsoft Office documents and standardizes the meta data of those documents (e.g. the author and company name). ...
1
by: tokcy | last post by:
Hi, I am embeding flash player in my site but i have some problem like... suppose i have 5 songs and i am playing one song but i want to play another while first one is not completed then both...
5
omerbutt
by: omerbutt | last post by:
hi i am trying to use javascript in the anchor tag within the href attribute but it is not picking the value instead it is posting the javascript as a text when i click that link here are the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.