mic138
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?
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?
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.
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.
MsgBox objVariable Is Nothing