Link to home
Start Free TrialLog in
Avatar of mirghani
mirghani

asked on

Run time error '7002'

hi i'm using active report and the report is working properly unless i Make a dll of the Report Class and import it in the component service i started getting this error:
Run Time error '7002
'Application-defined or Object-defined error'.
Any Help ???
Avatar of mirghani
mirghani

ASKER

here is my Report Dll Code:
Option Explicit

Public Function GetReport(ByVal iReport As Integer) As Object
Dim rpt As Object

    On Error GoTo ehGetReport
    Select Case iReport
    Case 1:
        Set rpt = New TempTripsReport
    Case 2:
        Set rpt = New CandReport
    Case Else
        Set rpt = Nothing
    End Select
   
exGetReport:
    Set GetReport = rpt
    Exit Function
   
ehGetReport:
    Debug.Print Err.Description
    Set rpt = Nothing
    Resume exGetReport
End Function

the following is the .dsr in the same Dll
TempTripsReport
CandReport
and the following is the Client Code:

Dim MyCls As MyRep_Prj.MyClsReportManager
Set MyCls = New MyRep_Prj.MyClsReportManager
Dim MyRepObj As Object
Set MyRepObj = MyCls.GetReport(2)
Set frmarv.arv.ReportSource = MyRepObj
frmarv.Show 1
Set MyCls = Nothing
Set MyRepObj = Nothing
 then the '7002' error raise.
hi,
would u plz tell me by debuging at what line it's giving error in ur above code?
hi,
actually it's a dll so i can't recognize at which line the error occur and if i copy and paste the code in a Class in an EXE it works fine:-(
Regards.
ASKER CERTIFIED SOLUTION
Avatar of VBMeera
VBMeera

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Sorry for Delay:-)
Meer.