|
-
Dec 11th, 2001, 10:54 AM
#1
Thread Starter
Registered User
HELP! OLE Microsoft Excel Chart
I have a textBox on a user form, with an embedded OLE Microsoft Chart. What I need to do is when the user inputs a value in the text box, write it to Sheet1 of the worksheet using the text1_change function. but, i don't know the code to write that value to that embedded worksheet. Thanks,
JeFF
-
Dec 11th, 2001, 12:53 PM
#2
Addicted Member
Try something like this:
Code:
Option Explicit
Const OLE_CREATE_EMBED = 0
Private Sub Command1_Click()
Dim objChart As Object
OLE1.Class = "Excel.Chart.8"
OLE1.Action = OLE_CREATE_EMBED
Set objChart = OLE1.object
objChart.Worksheets("Sheet1").Cells(4, 3).Value = Text1.Text
End Sub
This will assign the text in textbox Text1 to the cell at row 4, column 3 when button Command1 is pressed.
-mort
-
Dec 11th, 2001, 01:03 PM
#3
Addicted Member
-
Dec 11th, 2001, 01:32 PM
#4
Thread Starter
Registered User
thanks so much! that works perfectly. I have been trying to do that for a while now.
JEFF
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
|