Excel Simple
How to:
- Create and Excel file
- Add a Workbook and Sheet
- Add some styling elements (coloring cells)
- Insert data
var objXL = WScript.CreateObject("Excel.Application");
objXL.Visible = true;
objXL.WorkBooks.Add();
objXL.Sheets.Add();
objXL.Sheets.Add();
objXL.Sheets.Add();
objXL.Sheets.Add();
objXL.Sheets("Sheet1").Select();
objXL.Columns(1).ColumnWidth = 40;
objXL.Columns(2).ColumnWidth = 20;
objXL.Sheets("Sheet1").Select();
objXL.Sheets("Sheet1").Name = "WSH Test";
objXL.Cells(1, 1).Select();
objXL.Selection.Interior.ColorIndex = 40;
objXL.Cells(1, 2).Select();
objXL.Selection.Interior.ColorIndex = 40;
objXL.Cells(1, 1).Value = "Name";
objXL.Cells(1, 2).Value = "Phone";
objXL.Cells(2, 1).Value = "Blow, Joe";
objXL.Cells(2, 2).Value = "555-5555";
objXL.Cells(3, 1).Value = "Smith, John";
objXL.Cells(3, 2).Value = "555-1212";