Every ByteScout tool contains example VBScript source codes that you can find here or in the folder with installed ByteScout product. What is ByteScout Spreadsheet SDK? It is the SDK that can write and read, modify and calculate Excel and CSV spreadsheets. Most popular formulas are supported. You may import or export data to and from CSV, XML, JSON as well as to and from databases, arrays. It can help you to add images to spreadsheet in your VBScript application.
You will save a lot of time on writing and testing code as you may just take the VBScript code from ByteScout Spreadsheet SDK for add images to spreadsheet below and use it in your application. This VBScript sample code is all you need for your app. Just copy and paste the code, add references (if needs to) and you are all set! Enjoy writing a code with ready-to-use sample VBScript codes.
Free trial version of ByteScout Spreadsheet SDK is available for download from our website. Get it to try other source code samples for VBScript.
Set document = CreateObject("Bytescout.Spreadsheet.Spreadsheet") document.RegistrationName = "demo" document.RegistrationKey = "demo" ' Add new worksheet Set worksheet = document.Workbook.Worksheets.Add("HelloWorld") Set pictures = worksheet.Pictures ' add a picture to specified cell pictures.Add 1, 1, "image1.jpg" ' add a picture by absolute pixel coordinates pictures.Add_3 "image2.jpg", 550, 100 ' fit picture into cell range Set picture = pictures.AddAndFitInto(27, 1, 32, 5, "image1.jpg") ' rotate the last added picture picture.Rotation = 45 ' delete output file if exists already Set fso = CreateObject("Scripting.FileSystemObject") If (fso.FileExists("Output.xls")) Then fso.DeleteFile("Output.xls") Set fso = nothing ' save document document.SaveAs "Output.xls" ' close Spreadsheet Set document = Nothing