0

I am trying to convert the following code to OPEN-XML C#.

Scenario - Template has been created by the user using the XML mapping provided by Ecxel. The following code opens the template and imports the XML data file (dataPath) and saves it as final report. How can I achieve the same thing using openXML SDK. This is because this component is deployed in IIS.

        var exApp = new Microsoft.Office.Interop.Excel.Application();
        Microsoft.Office.Interop.Excel.Workbook xlWorkBook = null;
        object misValue = System.Reflection.Missing.Value;

        exApp.Visible = false;
        xlWorkBook = exApp.Workbooks.Open(@"D:\New.xlsx");

        Microsoft.Office.Interop.Excel.XmlMap x = null;
        xlWorkBook.XmlImport(dataPath, out x, Type.Missing, Type.Missing);
        xlWorkBook.Save();
        xlWorkBook.Close(true, misValue, misValue);
        exApp.Quit();
user2943193
  • 41
  • 1
  • 12
  • This is very close to a "giv me the codez" question. What have you tried to convert this? – Codeman Oct 31 '13 at 23:57
  • I checked OpenXML sdk, but wasnt able to find anything related to binding data. I just want to know is there a way to do this. – user2943193 Nov 01 '13 at 06:09

0 Answers0