OLE Container Control in VB.NET

Y

Yi

I am trying to create an application that hosts an Excel
Workbook in its form. With Visual Studio .NET and a VB
project, I can not find the "OLE Container Control" in its
toolbox. I know that VB6.0 has such a control in its
toolbox. How can I do this in VB.NET. Is it possible to do
this?

Many thanks in advance.
Yi
 
W

Wei-Dong Xu [MSFT]

Hi Yi,

Very good question!

Visual Studio .Net provides the same function. You can find the "Microsoft
Excel <version number> type library" from Project->Add Reference...->Com .
Then you can use object browser to explore the class namespace and take
advantage of it to develop your own application.

Does this answer your question? Thank you for using Microsoft NewsGroup!

Wei-Dong Xu
Microsoft Product Support Services
Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
Y

Yi

Thanks, Dong Xu.

By adding a reference to Excel object library into the
project, you can write VBA codes, such as "Dim workbooks
as Excel.Workbooks" and "workbooks.Open("abc.xls")". But
what I wanted to do is to have a control in the Form and
the control is an OLE container that hosts an Excel
Workbook.

In the Toolbox window, use "Customize Toolbox" context
menu item, a control can be added to toolbox. I can find
a "Microsoft Office Spreadsheet 10.0" control. But I don't
think its object model is exactly equivalent to the Excel
Workbook.

Yi
 
W

Wei-Dong Xu [MSFT]

Hi Yi,

Thank you for replying and the detailed information about this issue!

From my understanding to your issue now, you may use the Office SpreadSheet
control to build the Excel-like edit enviroment in your own application.
The spreadsheet control also provides the Excel-compatible object model
which will make your development fast. Furthermore, both Excel and
Spreadsheet support the common file format XML so that you can export the
data from Excel workbook as XML and then import them into spreadsheet
control. After the modification of your application users, you can save
them as xml format and then update the data in Excel workbook.

In addtion, Office Web component also contains one Spreadsheet control
which can be used in web pages. You can obtain web component Toolpack from
Microsoft.com. Please go to:
http://www.microsoft.com/downloads/details.aspx?FamilyId=BEB5D477-2100-4586-
A13C-50E56F101720&displaylang=en

Please feel free to let me know if you have any questions.

Does this answer your question? Thank you for using Microsoft NewsGroup!

Wei-Dong Xu
Microsoft Product Support Services
Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 
W

Wei-Dong Xu [MSFT]

Hi Yi,

Thank you for replying!

It is my pleasure to be some of service!

Please feel free to let me know if you have any questions.

Thank you once more for using Microsoft NewsGroup!

Wei-Dong Xu
Microsoft Product Support Services
Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
 

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