dc4life78
02-20-2009, 08:36 PM
Hey everyone,
I have created four embedded OLE Excel objects within my form and am trying to write data to them, but I cannot seem to access any of them. I have never used OLE objects so I'm at a loss at where to start beyond what I have so far which I have seen on various occasions in other forums:
Dim ctl As Control
Dim wks As Excel.Worksheet
Set ctl = Me.OLE1
Set wks = ctl.Object.Application.Workbooks(1).Worksheets(1)
If the Set command line worked correctly I would be go to go and simply proceed with Cells(X,Y).Value or Range("XX").Value. But this does not execute; I get an error message saying Object variable not set. What am I missing?
Thanks in advance for your help!
I have created four embedded OLE Excel objects within my form and am trying to write data to them, but I cannot seem to access any of them. I have never used OLE objects so I'm at a loss at where to start beyond what I have so far which I have seen on various occasions in other forums:
Dim ctl As Control
Dim wks As Excel.Worksheet
Set ctl = Me.OLE1
Set wks = ctl.Object.Application.Workbooks(1).Worksheets(1)
If the Set command line worked correctly I would be go to go and simply proceed with Cells(X,Y).Value or Range("XX").Value. But this does not execute; I get an error message saying Object variable not set. What am I missing?
Thanks in advance for your help!