Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Run-time error '430' / Class doesn't support Automation

I am trying to import data from one Excel sheet to
another, using ADO, and it doesn't work with Excel 97 as
it does with Excel 2000. I am running Excel 97 at work on
Win NT 4. Can anyone help me? Here is part of the code:
-------------------------
Public Sub LoadList()
Dim rsData As ADODB.Recordset
Dim szConnect As String
Dim szSQL As String

'Create for connection string
szConnect = "Provider=Microsoft.Jet.OLEDB.4.0;"
& "Data Source=D:\Reports\Totals.xls;" & "Extended
Properties=Excel 8.0;"
'Query based on a specific range address
szSQL = "SELECT * FROM [Summary$a2:b4]"

Set rsData = New ADODB.Recordset
rsData.Open szSQL, szConnect, adOpenForwardOnly,
adLockReadOnly, adCmdText
'Check to make sure data was received
If Not rsData.EOF Then
Groups.Range("A2:C501").CopyFromRecordset rsData
Else
MsgBox "No records returned.", vbCritical
End If

'Clean up the Recordset object
rsData.Close
Set rsData = Nothing

End Sub
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 208
Default Run-time error '430' / Class doesn't support Automation

Hi Mike,
Whenever I've got that message, it is because I'm trying to do
something like delete or close the file that contains the code. Is
your code trying to do that somewhere?
regards
Paul

"Mike" wrote in message ...
I am trying to import data from one Excel sheet to
another, using ADO, and it doesn't work with Excel 97 as
it does with Excel 2000. I am running Excel 97 at work on
Win NT 4. Can anyone help me? Here is part of the code:
-------------------------
Public Sub LoadList()
Dim rsData As ADODB.Recordset
Dim szConnect As String
Dim szSQL As String

'Create for connection string
szConnect = "Provider=Microsoft.Jet.OLEDB.4.0;"
& "Data Source=D:\Reports\Totals.xls;" & "Extended
Properties=Excel 8.0;"
'Query based on a specific range address
szSQL = "SELECT * FROM [Summary$a2:b4]"

Set rsData = New ADODB.Recordset
rsData.Open szSQL, szConnect, adOpenForwardOnly,
adLockReadOnly, adCmdText
'Check to make sure data was received
If Not rsData.EOF Then
Groups.Range("A2:C501").CopyFromRecordset rsData
Else
MsgBox "No records returned.", vbCritical
End If

'Clean up the Recordset object
rsData.Close
Set rsData = Nothing

End Sub

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Run-time error '1004': AutoFill method of Range class failed murkaboris Excel Discussion (Misc queries) 10 April 16th 09 09:06 PM
Run-time error '1004': AutoFill method of Range class failed murkaboris Excel Discussion (Misc queries) 3 April 14th 09 10:35 PM
Run-Time error '1004' : Select method of Range class failed [email protected] Excel Discussion (Misc queries) 3 March 9th 07 01:36 PM
Class doesn't support Automation... Nathan Stevens Excel Programming 1 August 7th 03 02:08 PM
HELP!! Excel 2000 Copy of worksheet class failed run time Error 1004 Martin[_6_] Excel Programming 1 August 2nd 03 03:16 PM


All times are GMT +1. The time now is 07:34 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"