File tree Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Expand file tree Collapse file tree 1 file changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -25,5 +25,26 @@ public static object RtdArrayTest(string prefix)
2525 result [ 1 , 0 ] = parts [ 1 ] ;
2626 return result ;
2727 }
28+
29+ // NOTE: This is that problem case discussed in https://groups.google.com/d/topic/exceldna/62cgmRMVtfQ/discussion
30+ // It seems that the DisconnectData will not be called on updates triggered by parameters from the sheet
31+ // for RTD functions that are marked IsMacroType=true.
32+ [ ExcelFunction ( IsMacroType = true ) ]
33+ public static object RtdArrayTestMT ( string prefix )
34+ {
35+ object rtdValue = XlCall . RTD ( "RtdArrayTest.TestRtdServer" , null , "X" + prefix ) ;
36+
37+ var resultString = rtdValue as string ;
38+ if ( resultString == null )
39+ return rtdValue ;
40+
41+ // We have a string value, parse and return as an 2x1 array
42+ var parts = resultString . Split ( ';' ) ;
43+ Debug . Assert ( parts . Length == 2 ) ;
44+ var result = new object [ 2 , 1 ] ;
45+ result [ 0 , 0 ] = parts [ 0 ] ;
46+ result [ 1 , 0 ] = parts [ 1 ] ;
47+ return result ;
48+ }
2849 }
2950}
You can’t perform that action at this time.
0 commit comments