Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default UDF's and Workbook events

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!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default UDF's and Workbook events

Try DIMming the array in a module before any functions or sub. Also BE SURE
to DIM it as Public.
--
Gary''s Student - gsnu200746


"BigJimmer" wrote:

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!

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 37
Default UDF's and Workbook events

That's what I did. I've made that mistake before, so I checked it a few
times before I posted.

"Gary''s Student" wrote:

Try DIMming the array in a module before any functions or sub. Also BE SURE
to DIM it as Public.
--
Gary''s Student - gsnu200746


"BigJimmer" wrote:

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!

Reply
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
Help on Workbook close and workbook save events Adam Harding Excel Programming 1 September 29th 05 04:12 PM
workbook events [email protected] Excel Programming 2 August 23rd 05 09:14 AM
Workbook Events Don Lloyd Excel Programming 2 September 9th 04 02:55 PM
How to handle other workbook events through personal.xls workbook ivarsb Excel Programming 1 July 27th 04 01:35 PM
Workbook Events Geoff[_8_] Excel Programming 0 September 13th 03 09:28 AM


All times are GMT +1. The time now is 05:34 PM.

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

About Us

"It's about Microsoft Excel"