Change Document Properties | VB.NETBytescout Spreadsheet SDK

Change Document Properties | VB.NET

Module1.vb:

VB
Imports System
Imports System.Collections.Generic
Imports System.Text
Imports System.IO
Imports Bytescout.Spreadsheet

Module Module1

    Sub Main()
        ' Create new Spreadsheet
        Dim document As New Spreadsheet()

        ' Add new worksheet
        Dim worksheet As Worksheet = document.Workbook.Worksheets.Add("Sheet1")

        ' Set some properties
        document.Workbook.Properties.ApplicationName = "Bytescout Spreadsheet SDK"
        document.Workbook.Properties.Author = "Bytescout"
        document.Workbook.Properties.Comments = "Some comments"
        document.Workbook.Properties.Subject = "Some subject"


        ' 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