|
-
Feb 24th, 2008, 09:42 PM
#1
Thread Starter
Addicted Member
Inserted Excel Worksheet
Dear Anyone
I've inserted from Insertable Objects Microsoft Excel Worksheet
What is the procedure to start this worksheet running
Why is that the gridlines are shown on the form of Excel Worksheet
and the Worksheet itself is not displayed when dragged from toolbox to
the working enviornment of the form ?
How do i get the data on Cell (1, 1) from a text box
Thanks
Sam F
-
Feb 25th, 2008, 06:55 AM
#2
Re: Inserted Excel Worksheet
I don't understand what you mean by "start the work sheet running."
Excel really doesn't start or stop, it just is.
-
Feb 25th, 2008, 09:33 AM
#3
Thread Starter
Addicted Member
Re: Inserted Excel Worksheet
Hi Hack
What i mean is to open or display the worksheet
Regards
SamF
-
Feb 25th, 2008, 05:21 PM
#4
Re: Inserted Excel Worksheet
I've inserted from Insertable Objects Microsoft Excel Worksheet
I'm not sure what you are referring to here, is this something which is provided in the VB Editor (thus VBA) within an Office application? I can't find it in VB6.
Unfortunately without knowing what quite you are doing so far, we can't really help with the next steps.
-
Feb 26th, 2008, 01:41 AM
#5
Thread Starter
Addicted Member
Re: Inserted Excel Worksheet
Dear Si The geek
Go to the menu PROJECTS
click on Components
and select Insertable Objects
and Tick on Microsoft Excel Worksheet
Then in the ToolBox Icon of Excel SHEET will display.
This Sheet Icon i drag and place it to the Form
So i've have a text box whre i want to enter the data and the same data
should be displayed in the Excel Sheet Cell (2,1)
Regards
Sam F
-
Feb 26th, 2008, 04:48 AM
#6
Thread Starter
Addicted Member
Re: Inserted Excel Worksheet
Any one
Private Sub Sheet1_Validate(Cancel As Boolean)
'What do i write in
End Sub
Private Sub Sheet1_GotFocus()
'What do i write in
End Sub
Basically when the Form is loaded
This Excel Worksheet should be opened
Why Do i have to click on Sheet1 twice
Why it cannot open on the form by itself.
Regards
SamF
-
Feb 27th, 2008, 04:17 PM
#7
Re: Inserted Excel Worksheet
I had a bit of a play around, but I can't find any way to actually reference the sheet (or workbook etc) with that method.
What you could do instead (if you want to keep it inside your form) is use the OLE control, set the Class to Excel.Sheet , and then use code like this:
Code:
'OLE1.object is equivalent to a WorkBook
OLE1.object.sheets(1).Cells(2, 1) = "hello"
..or if you want to do multiple things with it, like this:
Code:
With OLE1.object.sheets(1)
.Cells(2, 1) = "hello"
.Cells(2, 2) = "more text"
...
End With
If you are willing to have Excel run as a separate application to your program, see the Excel Tutorial link in my signature.
-
Feb 28th, 2008, 04:23 AM
#8
Thread Starter
Addicted Member
Re: Inserted Excel Worksheet
How do i load these OLE contorl ?
Regards
SamF
-
Feb 28th, 2008, 05:28 AM
#9
Re: Inserted Excel Worksheet
ole control is in the standard controls toolbox
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|