ByteScout Barcode Suite - VB.NET - Set date formatting in cells with spreadsheet sdk - ByteScout

ByteScout Barcode Suite – VB.NET – Set date formatting in cells with spreadsheet sdk

  • Home
  • /
  • Articles
  • /
  • ByteScout Barcode Suite – VB.NET – Set date formatting in cells with spreadsheet sdk

How to set date formatting in cells with spreadsheet sdk in VB.NET using ByteScout Barcode Suite

Learning is essential in computer world and the tutorial below will demonstrate how to set date formatting in cells with spreadsheet sdk in VB.NET

The sample source code below will teach you how to set date formatting in cells with spreadsheet sdk in VB.NET. ByteScout Barcode Suite is the bundle that privides 3 SDK products to generate barcodes (Barcode SDK), read barcodes (Barcode Reaer SDK) and read and write spreadsheets (Spreadsheet SDK). It can be applied to set date formatting in cells with spreadsheet sdk using VB.NET.

The SDK samples given below describe how to quickly make your application do set date formatting in cells with spreadsheet sdk in VB.NET with the help of ByteScout Barcode Suite. IF you want to implement the functionality, just copy and paste this code for VB.NET below into your code editor with your app, compile and run your application. This basic programming language sample code for VB.NET will do the whole work for you to set date formatting in cells with spreadsheet sdk.

The trial version of ByteScout Barcode Suite can be downloaded for free from our website. It also includes source code samples for VB.NET and other programming languages.

On-demand (REST Web API) version:
 Web API (on-demand version)

On-premise offline SDK for Windows:
 60 Day Free Trial (on-premise)

Module1.vb
      
Imports Bytescout.Spreadsheet Imports System.IO Imports System.Diagnostics Module Module1 Sub Main() ' Create new Spreadsheet Dim document As New Spreadsheet() ' Get worksheet by name Dim worksheet As Worksheet = document.Workbook.Worksheets.Add("Sample") ' Set captions worksheet.Cell(0, 0).Value = "#" worksheet.Cell(0, 1).Value = "Date" For i As Integer = 1 To 7 ' Set number worksheet.Cell(i, 0).Value = i ' Set current cell Dim currentCell As Cell = worksheet.Cell(i, 1) ' Set date to the current date time currentCell.ValueAsDateTime = DateTime.Now ' Set date format currentCell.NumberFormatString = "dd.mm.yyyy" Next ' 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

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout Barcode Suite Home Page

Explore ByteScout Barcode Suite Documentation

Explore Samples

Sign Up for ByteScout Barcode Suite Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

VIDEO

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout Barcode Suite Home Page

Explore ByteScout Barcode Suite Documentation

Explore Samples

Sign Up for ByteScout Barcode Suite Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

Tutorials:

prev
next