从excel更新外部系统

我之前看到的演示显然是可能的,但没有抓到足够的细节

我打算做一个函数调用如

=MyRTDReverse("keyvalue", "fieldName", [AC51]) 

要么

 =MyRTDReverse("keyvalue", [AB51], [AC51]) // where AB51 has the field name and AC51 has the field value 

等等

更新单元格AC51中的值会触发更改

任何样品/模式如何工作?

更新 – 使用.net 3.5 + VSTO UPDATE 2 – 宁愿不使用VSTO,而是像调用例程一样使用UDF / RTD

要根据单元格中的值更改来触发某些内容,请处理Worksheet_Change事件:

 Private Sub Worksheet_Change(ByVal Target As Range) 'here, check whether Target, a Range, is one of your "trigger" cells, 'and if it is, react accordingly End Sub 

定义一个自定义函数:

 Function MyFunction(Argument1, Argument2) 'do stuff with your arguments, and set MyFunction equal to the return value End Function 

在一个单元格中,你可以使用像= MyFunction("value", 3)