hazlehurstga
Programmer
When I execute this statement ".[a1].Offset(1).CopyFromRecordset NAVICPGListTable" from code below I receive the following error: "Run-time error '430': Class does not support Automation or does not support expected interface"
Does anyone know why this statement does not work in MSAcess 2003? NOTE: The recordset 'NAVICPGListTable' refers to a table in an external database, not the current db.
Thanks. Code excerpt follows:
"With Workbooks("OverallGAge.xls").Worksheets("Chart Data")
' Clear existing data
.Range("A2:CJ300").Clear
Set db = currentDB
' Define the SQL statement to retrieve NAVICP average G age data
SQLString = "SELECT a.SOURCEFILENAME, Avg(a.[AvgOfG AGE]) AS [AvgOfAvgOfG AGE] " & _
"FROM [NAVICP COMPONENT AVG G AGE CALCULATION] AS a " & _
"GROUP BY a.SOURCEFILENAME " & _
"ORDER BY a.SOURCEFILENAME;"
' Open the recordset
Set NAVICPGListTable = db2.OpenRecordset(SQLString)
' Transfer the records into excel
.Visible = True
Excel.Application.Visible = True
.Activate
".[a1].Offset(1).CopyFromRecordset NAVICPGListTable
' Get total rows
Does anyone know why this statement does not work in MSAcess 2003? NOTE: The recordset 'NAVICPGListTable' refers to a table in an external database, not the current db.
Thanks. Code excerpt follows:
"With Workbooks("OverallGAge.xls").Worksheets("Chart Data")
' Clear existing data
.Range("A2:CJ300").Clear
Set db = currentDB
' Define the SQL statement to retrieve NAVICP average G age data
SQLString = "SELECT a.SOURCEFILENAME, Avg(a.[AvgOfG AGE]) AS [AvgOfAvgOfG AGE] " & _
"FROM [NAVICP COMPONENT AVG G AGE CALCULATION] AS a " & _
"GROUP BY a.SOURCEFILENAME " & _
"ORDER BY a.SOURCEFILENAME;"
' Open the recordset
Set NAVICPGListTable = db2.OpenRecordset(SQLString)
' Transfer the records into excel
.Visible = True
Excel.Application.Visible = True
.Activate
".[a1].Offset(1).CopyFromRecordset NAVICPGListTable
' Get total rows