ByteScout Data Extraction Suite - VB.NET - Convert template to xls with spreadsheet sdk - 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 Data Extraction Suite – VB.NET – Convert template to xls with spreadsheet sdk

  • Home
  • /
  • Articles
  • /
  • ByteScout Data Extraction Suite – VB.NET – Convert template to xls with spreadsheet sdk

How to convert template to xls with spreadsheet sdk in VB.NET and ByteScout Data Extraction Suite

If you want to learn more then this tutorial will show how to convert template to xls with spreadsheet sdk in VB.NET

Every ByteScout tool includes simple example VB.NET source codes that you can get here or in the folder with installed ByteScout product. ByteScout Data Extraction Suite can convert template to xls with spreadsheet sdk. It can be applied from VB.NET. ByteScout Data Extraction Suite is the set that includes 3 SDK products for data extraction from PDF, scans, images and from spreadsheets: PDF Extractor SDK, Data Extraction SDK, Barcode Reader SDK.

The SDK samples given below describe how to quickly make your application do convert template to xls with spreadsheet sdk in VB.NET with the help of ByteScout Data Extraction Suite. Follow the instructions from scratch to work and copy the VB.NET code. Applying VB.NET application mostly includes various stages of the software development so even if the functionality works please test it with your data and the production environment.

If you want to try other source code samples then the free trial version of ByteScout Data Extraction Suite is available for download from our website. Just try other source code samples for VB.NET.

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

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

Program.vb
      
Imports System.Diagnostics Imports System.IO Imports Bytescout.Spreadsheet Class Program Friend Shared Sub Main(args As String()) ' Open spreadsheet from file Dim document As New Spreadsheet() document.LoadFromFile("template.xls") ' Get first worksheet Dim worksheet As Worksheet = document.Workbook.Worksheets(0) ' Find macros and replace them with values Replace(worksheet, "<PRODUCT_NAME1>", "Product 1", Nothing) Replace(worksheet, "<PRODUCT_NAME2>", "Product 2", Nothing) Replace(worksheet, "<PRICE1>", 24.99F, "0.00") Replace(worksheet, "<PRICE2>", 29.99F, "0.00") Replace(worksheet, "<QANTITY1>", 5, Nothing) Replace(worksheet, "<QANTITY2>", 10, Nothing) ' Delete output file if exists If File.Exists("output.xls") Then File.Delete("output.xls") End If ' Save document document.SaveAs("output.xls") ' Close spreadsheet document.Close() ' Open generated XLS document in default application Process.Start("output.xls") End Sub Private Shared Sub Replace(worksheet As Worksheet, macro As String, value As Object, format As String) Dim cell As Cell = worksheet.Find(macro, True, False, False) While cell IsNot Nothing cell.Value = value If Not [String].IsNullOrEmpty(format) Then cell.NumberFormatString = format End If cell = worksheet.FindNext() End While End Sub End Class

ON-PREMISE OFFLINE SDK

60 Day Free Trial or Visit ByteScout Data Extraction Suite Home Page

Explore ByteScout Data Extraction Suite Documentation

Explore Samples

Sign Up for ByteScout Data Extraction 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 Data Extraction Suite Home Page

Explore ByteScout Data Extraction Suite Documentation

Explore Samples

Sign Up for ByteScout Data Extraction Suite Online Training

ON-DEMAND REST WEB API

Get Your API Key

Explore Web API Docs

Explore Web API Samples

Tutorials:

prev
next