Ask Your Question
0

LibreOfficeCalc 5.2.0.4 64 bit - Grabbing a Value from a DDE Cell

asked 2017-08-27 17:57:39 +0200

JRC gravatar image

Using Dynamic Data Exchange (DDE) Cell Formula for cell A1 =DDE("MT4","ASK",D3) MT4=Metatrader 4 trading platform (external program) ASK=Currency price D3= Currency pair (e.g., EUR/USD) Formula above works fine...cell displays currency price, WHICH CAN CHANGE EVERY SECOND Question... Would like to do the following in cell B1 IF(cell A1 >= "(A Fixed Value Set by Me)" then B1 = The ONE VALUE OF A1 (Not Formula) when condition occurs, otherwise B1=0) Possible? (or must manually use "paste only - number") Thanks!

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
0

answered 2017-08-27 23:02:29 +0200

librebel gravatar image

updated 2017-08-28 20:55:56 +0200

Hello @JRC,

For example suppose that you put your "Fixed Value Set by Me" into cell C1, then you could set the following formula to cell B1:

=IF($A$1>=$C$1;$A$1;0)


EDIT 20170828-1 :

To get only the contents of cell A1, you could try this:

=IF($A$1>=$C$1;CELL("CONTENTS";$A$1);0)

HTH, lb

edit flag offensive delete link more
0

answered 2017-08-28 16:02:15 +0200

JRC gravatar image

Hi... Thanks for your response.

Good suggestion and it does work.

However, it assigns the A1 FORMULA to B1 not just the A1 VALUE. Therefore, after the condition is met B1 is [=DDE("MT4","ASK",D3)] and the B1 value changes in unison with A1.

I am hoping to assign just the A1 VALUE to B1 AND only the ONE A1 value that occurs the first time the condition is met.

Right now, I have created a "Yes/No" flag in another cell that tells me the condition is met. If so, I then manually use "paste only - number" from A1 into B1 using a simple macro.

After much google time, I'm thinking this may not be possible because A1 is a "DDE" cell.

Thanks again...

JRC

edit flag offensive delete link more

Comments

i edited my answer with a formula that gets the cell contents of A1 .. hope that works,

cheers, lib

librebel gravatar imagelibrebel ( 2017-08-28 21:00:01 +0200 )edit

Thanks again lib. Unfortunately, cell B1 still changes in unison with values streaming into A1 when the condition is True. Thought about writing macro to "copy/paste number only" when condition is true. Tested "macro" approach with a simple function I found that plays sound ("beep") when condition is true. Computer was "beeping" every second because calc re-evaluates condition each time number changes in A1, so "copy/paste number" would also execute each time. Ah well. - Thanks again. JRC

JRC gravatar imageJRC ( 2017-08-29 18:01:57 +0200 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2017-08-27 17:57:39 +0200

Seen: 347 times

Last updated: Aug 28 '17