24. Mai 2017 08:05
Microsoft.Office.Interop.Excel.Application xlApp;
Microsoft.Office.Interop.Excel.Workbook xlWorkBook;
Microsoft.Office.Interop.Excel.Worksheet xlWorkSheet;
xlApp = new Microsoft.Office.Interop.Excel.Application();
xlWorkBook = xlApp.Workbooks.Open(@"\\srv\inc\Excel_Import_Beispiel_2.xlsx");
xlWorkSheet = (Microsoft.Office.Interop.Excel.Worksheet)xlWorkBook.Worksheets.get_Item(1);
xlWorkSheet.Cells[1, 1] = "NEWVALUE";
xlWorkBook.Save();
Name DataType Subtype Length
XlApp DotNet Microsoft.Office.Interop.Excel.ApplicationClass
XlWrkBk DotNet Microsoft.Office.Interop.Excel.Workbook
XlWrkSht DotNet Microsoft.Office.Interop.Excel.Worksheet
XlRange DotNet Microsoft.Office.Interop.Excel.Range
XlHelper DotNet Microsoft.Dynamics.Nav.Integration.Office.Excel.ExcelHelper
XlShts DotNet Microsoft.Office.Interop.Excel.Sheets
XlApp := XlApp.ApplicationClass;
XlWrkBk := XlHelper.CallOpen(XlApp, cv_FileName);
XlWrkSht := XlWrkBk.Worksheets.Item('Tabelle1');
XlRange.Value('NEWVALUE');
XlWrkBk.Save;
24. Mai 2017 09:44
24. Mai 2017 10:22
TempFileName := FileManagement.UploadFileSilent(ItemImportSetup."Excel File Name");
ExcelBuffer.UpdateBook(TempFileName, ItemImportSetup."Excel Sheet Name");
ExcelBuffer.WriteSheet('', COMPANYNAME, USERID);
ExcelBuffer.CloseBook;
24. Mai 2017 14:56