I'm trying to reference (and populate) the cells of an embedded excel worksheet in my Access report. I'm getting a runtime error teling me that "the object doesn't suppor this property or method".
This is the code:
Private Sub Report_Open(Cancel As Integer)
Dim dbs As DAO.Database
Dim rst As DAO.Recordset
Dim qdf As DAO.QueryDef
Dim xlsSheet As Object
Dim row As Long
'Specify Parameters
Set dbs = CurrentDb()
Set qdf = dbs.QueryDefs("qry_CTQ_TEST"
qdf("vid"
= 331
Set rst = qdf.OpenRecordset()
Set xlsSheet = Me!diagTemplate
row = 1
xlsSheet.Worksheets(1).Cells(1, 1) = "test"
' Obviously I'm going to populate cells with recordset
' But I'm stumpped on this less complicated step
rst.Close
Set rst = Nothing
Set qdf = Nothing
Set dbs = Nothing
Set xlsSheet = Nothing
End Sub
Any ideas what i'm doing wrong???
This is the code:
Private Sub Report_Open(Cancel As Integer)
Dim dbs As DAO.Database
Dim rst As DAO.Recordset
Dim qdf As DAO.QueryDef
Dim xlsSheet As Object
Dim row As Long
'Specify Parameters
Set dbs = CurrentDb()
Set qdf = dbs.QueryDefs("qry_CTQ_TEST"
qdf("vid"
Set rst = qdf.OpenRecordset()
Set xlsSheet = Me!diagTemplate
row = 1
xlsSheet.Worksheets(1).Cells(1, 1) = "test"
' Obviously I'm going to populate cells with recordset
' But I'm stumpped on this less complicated step
rst.Close
Set rst = Nothing
Set qdf = Nothing
Set dbs = Nothing
Set xlsSheet = Nothing
End Sub
Any ideas what i'm doing wrong???