Link Search Menu Expand Document

Create Spreadsheet - JavaScript

Spreadsheet SDK sample in JavaScript demonstrating ‘Create Spreadsheet’

HelloWorld.js
var document = WScript.CreateObject('Bytescout.Spreadsheet.Spreadsheet');

// Add new worksheet
var worksheet = document.Workbook.Worksheets.Add("HelloWorld");

// get cell value
var cell = worksheet.Item(0,0); // you can also use worksheet.Cell("A1") as well

// set cell value
cell.Value = "Hello, World!";

// delete output file if exists already
var fso = WScript.CreateObject('Scripting.FileSystemObject');
if (fso.FileExists('Output.xls')) { fso.DeleteFile('Output.xls'); }
fso = null;

// save document
document.SaveAs ('Output.xls');

// close Spreadsheet
document = null

Download Source Code (.zip)

Return to the previous page Explore Spreadsheet SDK