Link to home
Start Free TrialLog in
Avatar of mic138
mic138Flag for United States of America

asked on

Object variable or With block variable not set

Here is a snapshot of the code:

    Dim objJourn As DIVCourseView.Manage

   Set objJourn = New DIVCourseView.Manage
   objJourn.viewLibrary True  ' whereby viewLibrary is a method within the Manage class

Upon testing, the application does instantiate/Set the objJourn ok, yet, when I place the call to the viewLibrary method, I get the error msg "Object variable or With block variable not set ". The viewLibrary Sub has been declared Public.

The DIVCourseView.Manage class does have Private global variables as well as Passed Scripting Context objects, which are instantiated within the Public OnStartPage Sub. I wanted to indicate this in the event they may be a factor.

Are there any suggestions of what might be the cause of the error? Also, will the Passed Scripting Context in memory be passed to DIVCourseView module automatically when DIVCourseView.Manage is instantiated?


Avatar of AzraSound
AzraSound
Flag of United States of America image

Whats going on in viewLibrary?  Must be an object in there, perhaps that hasnt been properly instantiated.  Check all objects used within the viewLibrary routine, for debugging you can just do:

MsgBox objVariable Is Nothing
Avatar of mic138

ASKER

I can run the viewLibrary successfully without it being called by this instantiated object. I can call viewLibrary from an ASP page (successfully). Now I am trying to call it from another procedure within the same DLL, but different module.
ASKER CERTIFIED SOLUTION
Avatar of AzraSound
AzraSound
Flag of United States of America image

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
Avatar of mic138

ASKER

Thank you AzraSound for leading me to believe that the problem resided in the called viewLibrary Sub. If the second question, mentioned in the opening post, was answered first, then I would of found the problem.

The Passed Scripting Context  is indeed not passed automatically when the DIVCourseView.Manage is instantiated. Hence, the variable declarations, defined within viewLibrary and which utilize Response object properties, were failing.