"Run-time error '430' : Class does not support Automation or does

G

Guest

I have a report that I export data from my DB to Excel. Just recently I
installed SP 3 for Office 2000 Pro. Since then I have been receiving the
above error when my code runs. I can go to another machine with access and
probably no updates added to the machine and it works fine. I compared my
references against the other PC and they match. So far things I have tried
don't work. I have re-installed twice.

Here is a portion of my code;

Option Compare Database
Option Explicit

Function Loans()

' This function will gather the data from Access Tables and export the data
into the specified
' Excel spreadsheet listed below.

Dim xlobj As Object
Dim objWKB As Object, objSHT As Object
Dim rs As Recordset
Dim db As Database, intUserResponse As String
Dim StrB1 As String
Const conBtns As Integer = vbQuestion + vbYesNoCancel + vbDefaultButton1
+ vbApplicationModal
Const conSHEET1 = "May 06" 'This is the name of your worksheet
'Change this on a monthly basis

Const conBK = "S:\LOANPHON\Ln Reports\2006\06loans.xls" 'This is the
path for this report

Set xlobj = CreateObject("excel.application")
Set db = CurrentDb
xlobj.Application.Visible = True
With xlobj
.workbooks.Open FileName:=conBK
'Below is a list of all employees by branch, and by decision



'GREELEY BOOKED


'Populate BOOKED by Orig for Name
StrB1 = ("SELECT COUNT(APPROVEDBY), SUM(AMT)" _
& "FROM tblBookedLoans WHERE APPROVEDBY = 'NAME' AND OPRID =
131")
Set rs = db.OpenRecordset(StrB1, dbOpenSnapshot)
Set objSHT = .worksheets(conSHEET1)
With objSHT
.range("C4").copyfromrecordset rs <-- "FAILS HERE"
End With
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top