Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Custom function does not fire

I have a spreadsheet that collects temperature data via a DDE link to
another program. I want to be able to record the highest and lowest values
that I get each hour. My solution was to create a custom VBA function
(actually two separate functions for high and low) that simply declared a
module level array to hold the data. I call the function from a cell in the
spreadsheet. The function is passed the current value of another cell (the
cell containing the temperature) and compares it to the value currently
stored in the array. If the new value is higher (or lower) then it is
stored in the array. If not, it is ignored. The function returns the
current value of the array element so I can see the highs or lows on the
spreadsheet in an adjacent cell.

This works fine when I MANUALLY change the temperature values and the Hi and
Low cell values change as they should. However, it does not seem to "fire"
when I am connected via DDE and getting the values that way. My hi and low
never changes regardless of the values that I have gotten via DDE.

Automatic calculation is turned on. Pressing F9 does not fix the problem.

Can anyone tell me why my custom function does not fire when I am getting my
data via the DDE link?

Thanks


  #2   Report Post  
Posted to microsoft.public.excel.programming
JNW JNW is offline
external usenet poster
 
Posts: 480
Default Custom function does not fire

Where is the function located in your code? Is it in a worksheet change event?

"r" wrote:

I have a spreadsheet that collects temperature data via a DDE link to
another program. I want to be able to record the highest and lowest values
that I get each hour. My solution was to create a custom VBA function
(actually two separate functions for high and low) that simply declared a
module level array to hold the data. I call the function from a cell in the
spreadsheet. The function is passed the current value of another cell (the
cell containing the temperature) and compares it to the value currently
stored in the array. If the new value is higher (or lower) then it is
stored in the array. If not, it is ignored. The function returns the
current value of the array element so I can see the highs or lows on the
spreadsheet in an adjacent cell.

This works fine when I MANUALLY change the temperature values and the Hi and
Low cell values change as they should. However, it does not seem to "fire"
when I am connected via DDE and getting the values that way. My hi and low
never changes regardless of the values that I have gotten via DDE.

Automatic calculation is turned on. Pressing F9 does not fix the problem.

Can anyone tell me why my custom function does not fire when I am getting my
data via the DDE link?

Thanks



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,440
Default Custom function does not fire

What is the code of your function? What are the input values? How do you
call the function?

All input cells should be in the argument list of the function definition
and call, otherwise Excel is not aware of the need for recalculation.

--
Kind regards,

Niek Otten


"r" wrote in message
...
I have a spreadsheet that collects temperature data via a DDE link to
another program. I want to be able to record the highest and lowest values
that I get each hour. My solution was to create a custom VBA function
(actually two separate functions for high and low) that simply declared a
module level array to hold the data. I call the function from a cell in
the spreadsheet. The function is passed the current value of another cell
(the cell containing the temperature) and compares it to the value
currently stored in the array. If the new value is higher (or lower) then
it is stored in the array. If not, it is ignored. The function returns
the current value of the array element so I can see the highs or lows on
the spreadsheet in an adjacent cell.

This works fine when I MANUALLY change the temperature values and the Hi
and Low cell values change as they should. However, it does not seem to
"fire" when I am connected via DDE and getting the values that way. My hi
and low never changes regardless of the values that I have gotten via DDE.

Automatic calculation is turned on. Pressing F9 does not fix the problem.

Can anyone tell me why my custom function does not fire when I am getting
my data via the DDE link?

Thanks



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default Custom function does not fire

Is the problem fixed if you double click the cell with your function?
Try adding Application.Volatile to the code.

cr

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
Event doesn't fire Frank Xia Excel Discussion (Misc queries) 6 February 11th 06 12:54 AM
Emulate Index/Match combo function w/ VBA custom function Spencer Hutton Excel Worksheet Functions 2 May 2nd 05 05:26 PM
VBA-Make Custom Menu Item Fire d_rodman Excel Programming 3 July 27th 04 03:29 PM
Adding a custom function to the default excel function list DonutDel Excel Programming 3 November 21st 03 03:41 PM
Workbook_SheetChange will not fire Robert Willard Excel Programming 1 September 10th 03 07:52 PM


All times are GMT +1. The time now is 10:28 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"