Hi everybody,
i need your help for something simple.
I have a function which is in one class, which takes parameters. Let's say =getid(a). When you are on a selected cell, you enter it then it writes the result.
Then I have a ribbon which is in my .dna file , and on this ribbon i made a combobox with text input fields. When i am on a cell and i enter my values in the text boxes (for exemple one value "a"), i would like to lauch my function =getid(a)
What i've tried :
In my .dna page i have :
<comboBox id="comboBox1"
enabled="true"
getText="GetText"
getLabel="GetLabel"
image="camera.bmp"
OnChange="OnChange" />
on another class that handles actions of buttons from the ribbon (not in my .dna file) :
if (control.Id == "comboBox1")
{
string isin;
isin = comboBox1.Text
//the following part works
ExcelReference cell = (ExcelReference)XlCall.Excel(XlCall.xlfCaller);
string lFullSheetName = (string)XlCall.Excel(XlCall.xlSheetNm, cell);
int lIndex = lFullSheetName.IndexOf("]");
string lSheetName = lFullSheetName.Substring(lIndex + 1);
Excel.Application xlApp = (Excel.Application)ExcelDnaUtil.Application;
int l = xlApp.ActiveCell.Row;
int c = xlApp.ActiveCell.Column;
Excel.Application app = (Excel.Application)ExcelDna.Integration.ExcelDnaUtil.Application;
Excel.Worksheet xlSheet = (Excel.Worksheet)app.ActiveWorkbook.Worksheets[lSheetName];
xlSheet.Cells[l , c ].FormulaLocal =
DBSQL.Instance.id(isin);
}
The problem is that combobox1 is not known in the class.
1) is it possible to launch a function from the ribbon with parameters entered in the text boxes of a combobox of the ribbon ?
2) How ? Do I need two buttons (combobox to enter parameters, and another one that launches the function)?
3) How to launch this function?
Thank you in advance, i did not find anything understandable for me on google or forums.
Paul