Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel Sheet Control

Status
Not open for further replies.

babalas

Technical User
Apr 28, 2003
10
CA
HI,
I have a form and I have put an Excel Sheet control on the form. I have extracted some data from a database and I want to put the data onto the Excel control. The sheet is called "sheet1" which is the default. I am not sure how to access the "sheet1". The control is already on the form so what is the syntax to add the data to the sheet? Do I have to do all this?

Dim ExcelApp as Object
Dim ExcelWkb as Object
Dim ExcelSht as Object

Set ExcelApp = New Excel.Application
Set ExcelWkb = ExcelApp.Workbooks.Open("C:\Documents and Settings\cedross\Desktop\UniExample\EccNet_Data.xls")
Set ExcelSht = ExcelWkb.Sheets(1)

Any help would be appreciated. Thanks

babalas
 
You need to show the data in respective cell, i.e:

With ExcelSht
.Cells(8, 3).Value = "Testing"
.Cells(9, 3).Value = "Sheet"
End With
 
The sheet that I have does not have the cells property. That is why I was asking for the correct syntax for the referencing of the sheet control. I was wondering if setting up the application object and the workbook object waws neccessary?
 
Have you tried using the .Range property

Good Luck
--------------
As a circle of light increases so does the circumference of darkness around it. - Albert Einstein
 
It doesn't have the range property either. That's why I think that my references to the control sheet are not right. If someone has used this control before please let me know. Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top