When you download the source code from [caption id=“attachment_10266” align=“alignnone” width=“610” caption=“Export GridView Data to Excel using OpenXml”]
[/caption] http://www.codeproject.com/Tips/366446/Export-GridView-Data-to-Excel-using-OpenXml and try to transfer it to Excel from a single cell to another Excel file, it is not easy. I have broken a big chunk into a smaller unit to just output one value to an Excel workbook using OpenXML SDK. Below is the part of code segments that doing this. //Simple private void CreateExcelParts(SpreadsheetDocument spreadsheetDoc, string str) { //Create a Workbook WorkbookPart workbookPart = spreadsheetDoc.AddWorkbookPart(); CreateWorkbookPart(workbookPart); //Create a worksheet Worksheet worksheet = new Worksheet() { MCAttributes = new MarkupCompatibilityAttributes() { Ignorable = “x14ac” } }; worksheet.AddNamespaceDeclaration(“r”, “http://schemas.openxmlformats.org/officeDocument/2006/relationships"); worksheet.AddNamespaceDeclaration(“mc”, “http://schemas.openxmlformats.org/markup-compatibility/2006"); worksheet.AddNamespaceDeclaration(“x14ac”, “http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac"); //Create sheetviews SheetViews sheetViews = new SheetViews(); SheetView sheetView = new SheetView() { WorkbookViewId = (UInt32Value)0U }; //Create a cell or range Selection selection = new Selection() { ActiveCell = “A1” }; //Append range to sheetview sheetView.Append(selection); //Append sheetview to sheetviews sheetViews.Append(sheetView); int columnIndex = 0; SheetData sheetData = new SheetData(); UInt32Value rowIndex = 1U; //Create a row Row row1 = new Row() { RowIndex = rowIndex++, Spans = new ListValue