1. Code I Write in c# for change excel cell color. string path = Server.MapPath("~/Excel/ExcelTagging.xlsx") ;
XLWorkbook wb = new XLWorkbook(path);
IXLWorksheet ws = wb.Worksheets.First();
ws.Cell(2, "A").Style.Fill.BackgroundColor = XLColor.Yellow;
wb.SaveAs(path);
wb.Dispose();
2. My code of paramquery for bind excel data
var excelPath = '../../Excel/ExcelTagging.xlsx";
pq.excel.importXl({ url: excelPath }, function (wb) {
grid.importWb({ workbook: wb, extraRows: 100, extraCols: 100 });
grid.hideLoading();
})
Second code give error if bind modfied excel sheet.
Uncaught Error: Invalid XML: <?xml version="1.0" encoding="utf-8"?><Types xmlns="
http://schemas.openxmlformats.org/package/2006/content-types"><Default Extension="rels" ContentType="application/vnd.openxmlformats-package.relationships+xml" /><Default Extension="xml" ContentType="application/xml" /><Override PartName="/xl/workbook.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml" /><Override PartName="/xl/worksheets/sheet1.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml" /><Override PartName="/xl/theme/theme1.xml" ContentType="application/vnd.openxmlformats-officedocument.theme+xml" /><Override PartName="/xl/styles.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml" /><Override PartName="/docProps/core.xml" ContentType="application/vnd.openxmlformats-package.core-properties+xml" /><Override PartName="/docProps/app.xml" ContentType="application/vnd.openxmlformats-officedocument.extended-properties+xml" /><Override PartName="/xl/sharedStrings.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml" /></Types>
at Function.error (VM9 jquery.min.js:3:4022)
at Function.parseXML (VM9 jquery.min.js:3:4787)
at Object.readPaths (pqgrid.min.js:11890:25)
at Object.getWorkBook (pqgrid.min.js:11775:105)
at l (pqgrid.min.js:11839:54)
at XMLHttpRequest.r.onload (pqgrid.min.js:663:17)