I have this problem :

I need to get the code window of a particular class.

Say, ProjectName is "Project1" and
ComponentName is "Form1"

I have this code :

Public VBInstance as VBIDE.VBE

Dim objVBComponent AS VBComponent

sProjectName = "Project1"
sComponentName = "Form1"

'Error occurs at the following line
Set objVBComponent = VBInstance.VBProjects.Item _
(sProjectName).VBComponents.Item (sComponentName)
objVBComponent.CodeModule.CodePane.Show

When I run this code "Object or with Variable not set" error is popping up. I have added Microsoft VB Extensibility 6.0 Library.

How could I solve this problem?

Samarth