I have a class called Functions
which is in the namespace, let's say SomeNameSpace
. In the Functions
class I have a function called GetCurrentValue
which I am using to create an excel formula to display in the formula bar. I want the formula equation to start with =SomeNameSpace.Functions.GetCurrentValue
but when I try this
using System.IO;
using System;
namespace SomeNameSpace{
public class Functions{
public object GetCurrentValue (arg1, arg2...){
//GetCurrentValue method implementation
}
}
}
using System.IO;
using System;
using SomeNameSpace;
namespace AnotherNamespace{
public static bool SetFormula (string newFormula){ //newFormula value is "GetCurrentValue"
string sTemp = "=SomeNameSpace.Functions.";
string Formula = sTemp + newFormula;
return true;
}
Formula
only gets set to =GetCurrentValue
. I also realized that when I change sTemp
to a string other than =SomeNameSpace.Functions.
, for example, =SomeSpace.Functions.
, it works perfect, as in Formula
gets set to =SomeSpace.Functions.GetCurrentValue
.
Can anyone help me understand why this is happening and, if possible, how I can get to do what I want?