Using package = New ExcelPackage()
Dim workbook = package.Workbook
'*** Sheet 1
Dim worksheet = workbook.Worksheets.Add("Sheet1")
'*** Background
Using range As ExcelRange = worksheet.Cells("A1:C1")
range.Style.Font.Bold = True
range.Style.Fill.PatternType = OfficeOpenXml.Style.ExcelFillStyle.Solid
'Set Pattern for the background to Solid
range.Style.Fill.BackgroundColor.SetColor(System.Drawing.Color.FromArgb(79, 129, 189))
'Set color to dark blue
range.Style.Font.Color.SetColor(System.Drawing.Color.White)
range.Value = "Text"
End Using
'*** Merge Cell
Using range As ExcelRange = worksheet.Cells("B2:C5")
range.Merge = True
range.Style.Border.BorderAround(OfficeOpenXml.Style.ExcelBorderStyle.Medium, System.Drawing.Color.Blue)
range.Value = "Text 2"
End Using
package.SaveAs(New FileInfo(Server.MapPath("Xls/myExcel.xlsx")))
End Using