These sample source codes on this page below are demonstrating how to add background image in VB.NET. ByteScout Spreadsheet SDK can add background image. It can be used from VB.NET. ByteScout Spreadsheet SDK is the SDK component for writing, reading, modifying and calculating Excel and CSV spreadsheets. Can calculate and reculculate formulas with Excel installed. You may import or export data to and from CSV, XML, JSON. Supports export to databases, arrays, streams.
This code snippet below for ByteScout Spreadsheet SDK works best when you need to quickly add background image in your VB.NET application. In order to implement the functionality, you should copy and paste this code for VB.NET below into your code editor with your app, compile and run your application. Enjoy writing a code with ready-to-use sample codes in VB.NET.
Free trial version of ByteScout Spreadsheet SDK is available for download from our website. Get it to try other source code samples for VB.NET.
Imports System.Diagnostics Imports System.Drawing Imports System.IO Imports Bytescout.Spreadsheet Class Program Friend Shared Sub Main(args As String()) ' Create new spreadsheet (or open existing) Dim doc As New Spreadsheet() doc.RegistrationName = "demo" doc.RegistrationKey = "demo" ' Add worksheet Dim worksheet As Worksheet = doc.Worksheets.Add() ' Put background image on the worksheet worksheet.BackgroundPicture = Image.FromFile("image1.jpg") ' Save document doc.SaveAs("output.xls") ' Close spreadsheet doc.Close() ' Open generated XLS document in default application Process.Start("output.xls") doc.Dispose() End Sub End Class