c# - Updating an exiting excel sheet using epplus giving error -


i want update existing .xlsx file using epplus. have open office installed on system. want open sample.xlsx, created epplus first time , if file exists, updates it. using below code updating file, i'm getting

general input/output error

when trying open file using process.start("...")

excelpackage l_excelpackg = null;  excelworksheet l_excelsheet = null; //update existing file  fileinfo l_fileinfo = new fileinfo(@"c:\\files\\sample.xlsx"); l_excelpackg = new excelpackage(l_fileinfo); excelworkbook l_workbook = l_excelpackg.workbook; //get 10th sheet of excel update //1 9 sheets keep unchanged  l_excelsheet = l_workbook.worksheets[10]; l_excelsheet.cells.clear();  //first row having column names foreach (datacolumn l_dccolumn in p_dtselectedrows.columns) {     l_excelsheet.cells[1, l_intcolums].value =      p_dtselectedrows.columns[l_dccolumn.columnname].tostring();     l_excelsheet.cells[1, l_intcolums].style.font.bold = true;     l_intcolums++; }  byte[] l_bytearr = l_excelpackg.getasbytearray(); file.writeallbytes(p_strfilepath, l_bytearr);   processstartinfo l_objprocess = new processstartinfo(p_strfilepath); process.start(l_objprocess); l_excelpackg.dispose(); 

please suggest changes required in code?


Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -