Copy Worksheet - VB.NET
Spreadsheet SDK sample in VB.NET demonstrating ‘Copy Worksheet’
Module1.vb
Imports System
Imports System.Collections.Generic
Imports System.Text
Imports Bytescout.Spreadsheet
Imports System.Diagnostics
Imports System.IO
Module Module1
Sub Main()
' Open existing Spreadsheet
Dim document As New Spreadsheet()
document.LoadFromFile("input.xls")
' Create copy of worksheet
document.Workbook.Worksheets.Copy(0, 1, "Copy of Sheet1")
' 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
��' - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
' <