ByteScout Data Extraction Suite - VB.NET - Merge two documents 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 – Merge two documents with spreadsheet sdk

  • Home
  • /
  • Articles
  • /
  • ByteScout Data Extraction Suite – VB.NET – Merge two documents with spreadsheet sdk

How to merge two documents with spreadsheet sdk in VB.NET with ByteScout Data Extraction Suite

If you want to learn more then this tutorial will show how to merge two documents with spreadsheet sdk in VB.NET

The sample source code below will teach you how to merge two documents with spreadsheet sdk in 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. It can merge two documents with spreadsheet sdk in VB.NET.

Want to save time? You will save a lot of time on writing and testing code as you may just take the VB.NET code from ByteScout Data Extraction Suite for merge two documents with spreadsheet sdk below and use it in your application. Simply copy and paste in your VB.NET project or application you and then run your app! Enjoy writing a code with ready-to-use sample VB.NET codes.

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)

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 Spreadsheets Dim document1 As New Spreadsheet() document1.LoadFromFile("workbook1.xls") Dim document2 As New Spreadsheet() document2.LoadFromFile("workbook2.xls") ' Create output document Dim document3 As New Spreadsheet() ' Add new worksheet document3.Workbook.Worksheets.Add() ' Target row Dim targetRow As Integer = 0 For i As Integer = 0 To 9 ' Copy cells from first document For j As Integer = 0 To 11 document3.Worksheet(0).Cell(targetRow, j).Value = document1.Worksheet(0).Cell(i, j).Value Next targetRow += 1 Next For i As Integer = 0 To 9 ' Copy cells from second document For j As Integer = 0 To 11 document3.Worksheet(0).Cell(targetRow, j).Value = document2.Worksheet(0).Cell(i, j).Value Next targetRow += 1 Next ' remove output file if already exists If File.Exists("Output.xls") Then File.Delete("Output.xls") End If ' Save document document3.SaveAs("Output.xls") ' Close Spreadsheet document3.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 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