Dashboard > Public Content > ... > ExcelCom > Application.Caller from a COM Addin
  Public Content Log In   View a printable version of the current page.  
  Application.Caller from a COM Addin
Added by James Richardson, last edited by James Richardson on Aug 01, 2006
Labels: 
(None)

In VBA, you can use Application.Caller.Rows.Count to find out the expected size of an array forula, so you can return an array of the right size.

In c# you can also do this!

Check out the page Writing an Excel COM Addin first so you can get hold of the Application object.

Then:

Excel.Range range = (Excel.Range) application.get_Caller(System.Type.Missing);
			
int rows = range.Rows.Count;
int cols = range.Columns.Count;
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.1 Build:#806 May 06, 2007) - Bug/feature request - Contact Administrators