LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 40
Default How do I access a sub in a New Class

From project "VBAProject(Book1.xlsm):"I am trying to access sub
"subInNewClass" in a new class that is in Project "newclass(class
test.xlsm)". Both methods below produce errors.

Any help would be appreciated.


-----------------------------------
In Project newclass(class test.xlsm)

In Class Module Class1:

Option Explicit
Public Sub subInNewClass()
MsgBox "I'm in"
End Sub

In VBAProject(Book1.xlsm):

Set reference to Project newclass

In Userform1

Option Explicit
Dim qq As New Class1
Private Sub UserForm_Click()
qq.subInNewClass
End Sub
-----------------------------------------------------------
I also tried:

Option Explicit
Dim qq As Class1
Dim kk
Private Sub UserForm_Click()
Set kk = qq
kk.subInNewClass
End Sub


 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Class module to access range events Mark Excel Programming 2 April 15th 09 09:43 PM
To access a previous object via class module Pierre Archambault Excel Programming 3 December 31st 05 06:51 AM
How to access group buttons in Class Module? Myles[_9_] Excel Programming 7 December 10th 05 02:37 PM
Reference Class Module in Access from Excel [email protected] Excel Programming 2 September 28th 05 09:55 AM
Access to class property in other workbook BenD[_2_] Excel Programming 2 March 3rd 04 09:11 AM


All times are GMT +1. The time now is 05:37 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"