![]() |
When Class object get created
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 |
When Class object get created
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 -- Hope this helps. If it does, please click the Yes button. Thanks in advance for your feedback. Gary Brown "CmK" wrote: 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 |
When Class object get created
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 "Gary Brown" wrote: 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 -- Hope this helps. If it does, please click the Yes button. Thanks in advance for your feedback. Gary Brown "CmK" wrote: 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 |
All times are GMT +1. The time now is 12:41 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com