- Demo
- C# source
- VB.Net source
The sample demonstrates how to write an excel workbook to an XML file.
private void btnRun_Click(object sender, System.EventArgs e) { Workbook workbook = new Workbook(); Worksheet sheet = workbook.Worksheets[0]; sheet.Range["C10"].Style.KnownColor = ExcelColors.Gray25Percent; sheet.Range["C11"].Style.KnownColor= ExcelColors.Blue; sheet.Range["C11"].Style.KnownColor = ExcelColors.Gold; workbook.SaveAsXml("sample.xml"); System.Diagnostics.Process.Start(Path.Combine(Application.StartupPath,"Sample.xml")); }
Private Sub btnRun_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnRun.Click Dim workbook As Workbook = New Workbook() Dim sheet As Worksheet = workbook.Worksheets(0) sheet.Range("C10").Style.KnownColor = ExcelColors.Gray25Percent sheet.Range("C11").Style.KnownColor= ExcelColors.Blue sheet.Range("C11").Style.KnownColor = ExcelColors.Gold workbook.SaveAsXml("sample.xml") System.Diagnostics.Process.Start(Path.Combine(Application.StartupPath,"Sample.xml")) End Sub