Ejemplo n.º 1
0
        private static Excel.Range ToRange(ExcelReference excelReference)
        {
            Excel.Application app      = new Excel.Application(null, ExcelDnaUtil.Application);
            Excel.Range       refRange = app.Range(XlCall.Excel(XlCall.xlfReftext, excelReference, true));

            return(refRange);
        }
Ejemplo n.º 2
0
        internal static Excel.Range FromExcelReferenceToRange(ExcelReference excelReference)
        {
            Excel.Application app     = new Excel.Application(null, ExcelDnaUtil.Application);
            object            address = XlCall.Excel(XlCall.xlfReftext, excelReference, true);

            Excel.Range range = app.Range(address);
            return(range);
        }
        // this will be executing on the host's appdomain
        private static Excel.Range TransferableValueToRange(object transferableValue)
        {
            string address     = (string)transferableValue;
            var    application = new Excel.Application(null, ExcelDnaUtil.Application);
            var    range       = application.Range(address);

            range.OnDispose += (args) =>
            {
                range.Application.Dispose();
            };

            return(range);
        }