title: How to create a UDF that returns 2-D array
body: <p>and plots the result in 2-D cells in Excel? 
  I am using C#, .NET, Excel-DNA, Add-In Express RTD, </p>
  
  <p>Thanks </p>
  
  <p>Edit
  I tried <a href="http://excel-dna.net/2011/01/30/resizing-excel-udf-result-arrays/" rel="nofollow noreferrer">http://excel-dna.net/2011/01/30/resizing-excel-udf-result-arrays/</a>, does not work for me. 
  I want sth like this 
  MyUDF(param1, param2) returns a 2-D array like a table based on lengths of param1, param2
  say param1 is "a,b,c", param2 is "high,low", expected to return an array [3,2], and display the result in 3 rows by 2 columns  </p>
  
  <p>I also tried <a href="https://stackoverflow.com/questions/9668649/excel-exceldna-c-sharp-try-to-copy-bloomberg-bdh-behavior-writing-array-aft">Excel ExcelDNA C# / Try to copy Bloomberg BDH() behavior (writing Array after a web request)</a>,  it works fine. 
  but my requirement is backgroundworker will call RTD function, the RTD function is a multi-step process, first it will login(asychronous, then subscribe(asychronous), when I call xlcall.RTD from backgroundworker, it gives accessinviolation exception </p>