Hi Steven,
1. Add a reference to the interop assembly Microsoft.Office.Interop.Excel (if you haven’t got it already).
2. Get the root Application object with a call to ExcelDnaUtil.Application:
var xlApp = (Microsoft.Office.Interop.Excel)ExcelDnaUtil.Application;
3. Proceed as in VBA:
xlApp.ActiveCell.Value = "Hello";
-Govert
--
You received this message because you are subscribed to the Google Groups "Excel-DNA" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
exceldna+u...@googlegroups.com.
To post to this group, send email to exce...@googlegroups.com.
Visit this group at https://groups.google.com/group/exceldna.
For more options, visit https://groups.google.com/d/optout.
Oops – that should be:
var xlApp = (Microsoft.Office.Interop.Excel.Application)ExcelDnaUtil.Application;
(Of course you can simplify it with a ‘using’ statement…)
In that context the COM object model is the same as you have in VBA:
xlApp.Range["D3"].Value = "Hello";
xlApp.Range["Sheet1!D3"].Value = "Hello";
xlApp.ActiveSheet.Cells(3, 4).Value = "Hello";
-Govert
From: exce...@googlegroups.com [mailto:exce...@googlegroups.com] On Behalf Of Steven John Lally
Sent: 2 August 2016 12:14
To: Excel-DNA <exce...@googlegroups.com>
--