Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Excel / Programming / September 2007

Tip: Looking for answers? Try searching our database.

UDF's and Workbook events

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
BigJimmer - 20 Sep 2007 20:18 GMT
Hi,

I need to execute some code from an add-in within the Workbook_SheetChange
event.  As part of this I need a global array that I can update/use from
within an add-in UDF and this workbook event.

When I define a global array in an add-in module, I can update it via the
UDF's contained in the add-in, but I am unable to reference this array from
within the Workbook_SheetChange event.  If I attempt to use the array within
the event it shows as empty, even though it was populated in an earlier step.
 If I try to call a UDF function from this event instead, I get the compile
error 'Sub or Function not defined'.

Alternatively, I defined the global array within a module in the xls file.  
In this case I can reference the array from the workbook event, but cannot do
so from within the add-in UDF's. This gives me the compile error 'Variable
not defined'.

I'm using Excel 2000.

Thanks!
Gary''s Student - 20 Sep 2007 21:06 GMT
Try DIMming the array in a module before any functions or sub.  Also BE SURE
to DIM it as Public.  
Signature

Gary''s Student - gsnu200746

> Hi,
>
[quoted text clipped - 17 lines]
>
> Thanks!
BigJimmer - 20 Sep 2007 21:12 GMT
That's what I did.  I've made that mistake before, so I checked it a few
times before I posted.

> Try DIMming the array in a module before any functions or sub.  Also BE SURE
> to DIM it as Public.  
[quoted text clipped - 20 lines]
> >
> > Thanks!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.