ByteScout Spreadsheet SDK - VB.NET - Read Number Format In Cell - ByteScout
Announcement
Our ByteScout SDK products are sunsetting as we focus on expanding new solutions.
Learn More Open modal
Close modal
Announcement Important Update
ByteScout SDK Sunsetting Notice
Our ByteScout SDK products are sunsetting as we focus on our new & improved solutions. Thank you for being part of our journey, and we look forward to supporting you in this next chapter!

ByteScout Spreadsheet SDK – VB.NET – Read Number Format In Cell

  • Home
  • /
  • Articles
  • /
  • ByteScout Spreadsheet SDK – VB.NET – Read Number Format In Cell

How to read number format in cell in VB.NET using ByteScout Spreadsheet SDK

How to code in VB.NET to read number format in cell with this step-by-step tutorial

The coding tutorials are designed to help you test the features without need to write your own code. ByteScout Spreadsheet SDK is the SDK to create, read, modify and calculate spreadsheets. Formula calculations are supported, import and export to and from JSON, CSV, XML, databases, arrays. It can read number format in cell in VB.NET.

Fast application programming interfaces of ByteScout Spreadsheet SDK for VB.NET plus the instruction and the code below will help you quickly learn how to read number format in cell. In your VB.NET project or application you may simply copy & paste the code and then run your app! Code testing will allow the function to be tested and work properly with your data.

Our website provides trial version of ByteScout Spreadsheet SDK for free. It also includes documentation and source code samples.

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 Bytescout.Spreadsheet.Constants Imports System.IO Module Module1 Sub Main() ' Create new Spreadsheet Dim document As New Spreadsheet() document.LoadFromFile("Data.xls") ' Get worksheet by name Dim worksheet As Worksheet = document.Workbook.Worksheets.ByName("Sample") ' Check dates For i As Integer = 0 To 7 For j As Integer = 0 To 1 ' Set current cell Dim currentCell As Cell = worksheet.Cell(i, j) ' Get format type Dim formatType As NumberFormatType = currentCell.ValueDataTypeByNumberFormatString ' Write line Console.Write("Cell({0}:{1}) type is {2}. Value : ", i, j, formatType.ToString()) Select Case formatType Case formatType.DateTime ' Read datetime Dim datm As DateTime = currentCell.ValueAsDateTime ' Write date to console output Console.Write(datm.ToString()) Case formatType.General ' Write value to console output Console.Write(currentCell.Value) End Select Console.WriteLine() Next Next ' Close document document.Close() Console.ReadKey() End Sub End Module

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout Spreadsheet SDK Home Page

Explore ByteScout Spreadsheet SDK Documentation

Explore Samples

Sign Up for ByteScout Spreadsheet SDK 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 Spreadsheet SDK Home Page

Explore ByteScout Spreadsheet SDK Documentation

Explore Samples

Sign Up for ByteScout Spreadsheet SDK Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

Tutorials:

prev
next