Merge Cells - VB.NET
Spreadsheet SDK sample in VB.NET demonstrating ‘Merge Cells’
Module1.vb
Imports Bytescout.Spreadsheet
Imports System.IO
Module Module1
Sub Main()
' Create new Spreadsheet
Dim document As New Spreadsheet()
' Get worksheet by name
Dim worksheet As Worksheet = document.Workbook.Worksheets.Add("Sheet1")
' Merge cells
worksheet.Range("B6:D18").Merge()
' Write text
worksheet.Cell("C10").MergedWithCell.Value = "Bytescout.Spreadsheet"
' remove output file if already exists
If File.Exists("Output.xls") Then
File.Delete("Output.xls")
End If
' Save document
document.SaveAs("Output.xls")
' Close Spreadsheet
document.Close()
' open in default spreadsheets viewer/editor
Process.Start("Output.xls")
End Sub
End Module
Resources.Designer.vb
��' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
' <