close

I know this process can be done in VBA. I have done it. But using vba also
requires that I have a mechanism to run the code. This would either be a
timer, button, or event. However, I would like to, if possible, use the
tools available in Excel to create this quot;Dynamic Equation.quot;

I have a DDE Server called IQLink. I need to create function for the DDE
service. The service currently accepts equations in this format:
=IQLink|NGF6!Last (give last traded price for natural gas for january 06)

In cell A1, I have the Symbol (Manually Entered): NGF6

I need to create the equation that will still work as an equation in a
number of other cells based on that cell. Currently I have been able to make
the string value using: =quot;=IQLink|quot; amp; A1 amp; quot;!Lastquot;

This equation results in: =IQLink|NGF6!Last in the cell, but the problem is
obviously that I have created a string and now the service will not operate
on it. I need to get this result, but in the format of an equation so that
it will do the calculations using the DDE service.

In case you are not familiar with DDE, I believe if you know the answer in a
situation that is using a normal excel function, that would be helpful to me
as well.

I hope I have been descriptive enough. Thanks for the help.

This function may help you:Option Explicit
Function Eval(s As String) As Variant
With Application
.Volatile
Eval = .Evaluate(s)
End With
End Function

so if you have in A1 =1 1 as a text string, then =Eval(A1) will return a 2
--
Gary''s Studentquot;Forrestquot; wrote:

gt; I know this process can be done in VBA. I have done it. But using vba also
gt; requires that I have a mechanism to run the code. This would either be a
gt; timer, button, or event. However, I would like to, if possible, use the
gt; tools available in Excel to create this quot;Dynamic Equation.quot;
gt;
gt; I have a DDE Server called IQLink. I need to create function for the DDE
gt; service. The service currently accepts equations in this format:
gt; =IQLink|NGF6!Last (give last traded price for natural gas for january 06)
gt;
gt; In cell A1, I have the Symbol (Manually Entered): NGF6
gt;
gt; I need to create the equation that will still work as an equation in a
gt; number of other cells based on that cell. Currently I have been able to make
gt; the string value using: =quot;=IQLink|quot; amp; A1 amp; quot;!Lastquot;
gt;
gt; This equation results in: =IQLink|NGF6!Last in the cell, but the problem is
gt; obviously that I have created a string and now the service will not operate
gt; on it. I need to get this result, but in the format of an equation so that
gt; it will do the calculations using the DDE service.
gt;
gt; In case you are not familiar with DDE, I believe if you know the answer in a
gt; situation that is using a normal excel function, that would be helpful to me
gt; as well.
gt;
gt; I hope I have been descriptive enough. Thanks for the help.

Since you're passing the string to your UDF, I think you could drop the
..volatile portion.
Gary''s Student wrote:
gt;
gt; This function may help you:
gt;
gt; Option Explicit
gt; Function Eval(s As String) As Variant
gt; With Application
gt; .Volatile
gt; Eval = .Evaluate(s)
gt; End With
gt; End Function
gt;
gt; so if you have in A1 =1 1 as a text string, then =Eval(A1) will return a 2
gt; --
gt; Gary''s Student
gt;
gt; quot;Forrestquot; wrote:
gt;
gt; gt; I know this process can be done in VBA. I have done it. But using vba also
gt; gt; requires that I have a mechanism to run the code. This would either be a
gt; gt; timer, button, or event. However, I would like to, if possible, use the
gt; gt; tools available in Excel to create this quot;Dynamic Equation.quot;
gt; gt;
gt; gt; I have a DDE Server called IQLink. I need to create function for the DDE
gt; gt; service. The service currently accepts equations in this format:
gt; gt; =IQLink|NGF6!Last (give last traded price for natural gas for january 06)
gt; gt;
gt; gt; In cell A1, I have the Symbol (Manually Entered): NGF6
gt; gt;
gt; gt; I need to create the equation that will still work as an equation in a
gt; gt; number of other cells based on that cell. Currently I have been able to make
gt; gt; the string value using: =quot;=IQLink|quot; amp; A1 amp; quot;!Lastquot;
gt; gt;
gt; gt; This equation results in: =IQLink|NGF6!Last in the cell, but the problem is
gt; gt; obviously that I have created a string and now the service will not operate
gt; gt; on it. I need to get this result, but in the format of an equation so that
gt; gt; it will do the calculations using the DDE service.
gt; gt;
gt; gt; In case you are not familiar with DDE, I believe if you know the answer in a
gt; gt; situation that is using a normal excel function, that would be helpful to me
gt; gt; as well.
gt; gt;
gt; gt; I hope I have been descriptive enough. Thanks for the help.

--

Dave Peterson

arrow
arrow
    全站熱搜
    創作者介紹
    創作者 software 的頭像
    software

    software

    software 發表在 痞客邦 留言(0) 人氣()