Convert delimited text file to excel5/24/2023 ![]() ![]() The base of this sample was borrowed from here : Private static void Safe(object misValue, Workbook excellWorkBook, string excellfilename) ReleaseComObject(obj) Ĭonsole.WriteLine("Unable to release the Object " + ex) Private static void ReleaseObject(object obj) Safe(misValue, excellWorkBook, "") ĬloseQuitAndRelease(excellApp, excellWorkSheet, excellWorkBook, misValue) Var excellWorkSheet = (Worksheet) Ĭonst string InputfileName = "inputFile.txt" ĪddDataFromFile(excellWorkSheet, InputfileName) ![]() Throw new ArgumentNullException("excellWorkSheet") ĮxcellWorkSheet.Cells = value Īpplication excellApp, Worksheet excellWorkSheet, Workbook excellWorkBook, object misValue)ĮxcellWorkBook.Close(true, misValue, misValue) Private static void AddDataFromFile(_Worksheet excellWorkSheet, string fileName) It uses a reference to 14.0.0.0 namespace ConsoleApplication2 I did put together this console app for you. ![]()
0 Comments
Leave a Reply. |