Click to See Complete Forum and Search --> : ole excel


leary
April 28th, 2001, 05:48 PM
I've embedded excel in an ole container on a form but is not reading from the embedded object. However when i open the file independently the program reads from it fine. What should i change in order to read from the embedded object? Here is code

Private Sub Form_Load()
Dim intRow As Integer
Dim intCol As Integer
Set m_objApp = GetObject(, "Excel.Application")

Set m_objSheet = m_objApp.ActiveSheet
intRow = 3 'this row has the dates that need to be read

For intCol = 5 To 150 ' I want this to end of file
Debug.Print m_objSheet.Cells(intRow, intCol)
lstDisplayDates.AddItem m_objSheet.Cells(intRow, intCol)
Next intCol



End Sub
Thank You, more to come