Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Mar 2002
    Location
    Western NY, USA
    Posts
    157
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Calling a Class from another Worsheet (XL 2002, VBA 6.3)

    I would like to call a routine in another workbook.

    I have done the following:
    Created a class clsClr in workbook tryme.xls, set the instancing property to public, not creatable.
    Set a reference to tryme.xls in new workbook.

    However, I cannot figure out how to call any routines in the class.

    Class clsclr contains a routine

    Public Sub ShowForm()
    UserForm1.Show
    End Sub

    If, in my new workbook's IDE, I type "Dim x as " the dropdown shows tryme.clsClr, but I cannot create an instance of it.

    So how do I call this without creating an instance?

    If I need to call a routine in a module, I know how to do that, but I would like to use classes.
    Thanks.

  2. #2
    2 Star Lounger
    Join Date
    Mar 2002
    Location
    Western NY, USA
    Posts
    157
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Calling a Class from another Worsheet (XL 2002, VBA 6.3)

    I found the answer.
    Application.VBE.ActiveVBProject.VBComponents("Clas sname").Properties("Instancing") = 5

    It simply is not a property in the IDE.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •