Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Run time error '7002'

Posted on 2002-07-08
5
492 Views
Last Modified: 2009-12-16
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 ???
0
Comment
Question by:mirghani
  • 3
  • 2
5 Comments
 

Author Comment

by:mirghani
ID: 7137331
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.
0
 

Expert Comment

by:VBMeera
ID: 7139656
hi,
would u plz tell me by debuging at what line it's giving error in ur above code?
0
 

Author Comment

by:mirghani
ID: 7151030
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.
0
 

Accepted Solution

by:
VBMeera earned 200 total points
ID: 7153375
hello,
if ur calling dll using New object try with CreateObject,
may it will solves ur problem.
Thnaks
0
 

Author Comment

by:mirghani
ID: 7343998
Sorry for Delay:-)
Meer.
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

837 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question