Link to home
Start Free TrialLog in
Avatar of JOHNHO
JOHNHO

asked on

how do insert excell ws into vb project ?

please tell me how do i insert excell ws into the vb project ?

what control / components do i need insert ?

for your information i just want to insert abc.xls file only not the excell.exe. so my user can manipulate or using that ws as he/she like.

and that ws can be link with the data control.

i hope you understand it.

u got to answer the 3 question above.

ok.
thanks

Avatar of TimCottee
TimCottee
Flag of United Kingdom of Great Britain and Northern Ireland image

The simple answer to the first two questions, is to add an ole container control to the form.

Create a new project and add the ole control to the form, select create from file and point to abc.xls.

Run the project. When you double-click the control (you can do this programmatically as well). It will open a cut-down representation of excel in the current form which gives you full excel functionality. You can also use the excel automation object to programatically control the worksheet.

The third part of the question is contradictory to the first two because if you open the worksheet in this way there is no need to control it using the data control.

ASKER CERTIFIED SOLUTION
Avatar of pmcgivern
pmcgivern
Flag of Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of JOHNHO
JOHNHO

ASKER

problem


1. why in my components didnt see the ole object ? what and how do i get it ?

2. why when i try to set the recordsource with the xls file, it shows me that "coudnt ecrytp data"

why
The OLE object should be in your toolbox. It is usually the last one when you create a standard vb project after the intrinsic data control.
If you use the OLE control then the copy of excel it uses is the actual excel.exe - if this is not on the machine it won't work.  Using the DBGrid gets around this.  

As for the couldn't encrypt data message - I'm not sure.  I can't reproduce that here - there may be a problem with you xls file - it may have complex entries that the data control cannot understand.  If you want you could send me a copy of the xls at pmcgivern@hotmail.com and I can take a look.