When Class object get created

C

CmK

Hi

I have an addin and i need to use some of the objects in the funciton from
the addin in my open workbook event

but it is telling me object required .
My code works when the workbook has fully loaded

I am thinking the addin class doesnt get created until later when the
workbook is fully loaded

Can someone tell me when does the Addin object get created and why cant i
use it in the open event
plus can i create the class objects faster or force vba code to load these
objects first in my addin when my workbook open

Thanks
 
G

Gary Brown

Try Declaring your class in your 'ThisWorkbook' module BEFORE your first
procedure. Something like..

Option Explicit
'set up MyClass
Dim clsMyClass As New Class_MyClass

Sub My1stProcedure
Msgbox "Hello"
End Sub
 
C

CmK

Nah that wasnt it
It is something to do with when the addin creates the class I think its a
com addin

I guess i have to read up on it

Thanks anyways
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top