Exemplo n.º 1
0
        void app_WorkbookAfterXmlImport(Microsoft.Office.Interop.Excel.Workbook wb, Microsoft.Office.Interop.Excel.XmlMap map, bool isRefresh, Microsoft.Office.Interop.Excel.XlXmlImportResult Result)
        {
            string workbookName = "";
            string mapName      = map.Name;
            string refresh      = "false";


            try
            {
                workbookName = wb.Name;
                if (isRefresh)
                {
                    refresh = "true";
                }
            }
            catch (Exception e)
            {
                string errorMsg = e.Message;
                workbookName = "error: " + errorMsg;
            }

            notifyWorkbookAfterXmlImport(workbookName, mapName, refresh);
        }
Exemplo n.º 2
0
        public void WorkbookAfterXmlImport(Microsoft.Office.Interop.Excel._Workbook oWB, Microsoft.Office.Interop.Excel.XmlMap oMap, bool IsRefresh, Microsoft.Office.Interop.Excel.XlXmlImportResult Result)
        {
            if (xlWorkbookAfterXmlImport != null)
            {
                if (!m_DisableEventsIfEmbedded ||
                    (m_DisableEventsIfEmbedded && !IsEmbedded(ref oWB)))
                {
                    xlWorkbookAfterXmlImport(oWB, oMap, IsRefresh, Result);
                }
            }

            //Release any COM objects passed into the event
            ComRelease(oWB);
            ComRelease(oMap);
        }