Question: I need to add a row to a spreadsheet using VBScript on a PC that does not have Microsoft Office installed.

I tried [`Set objExcel = CreateObject("Excel.Application")`]

Since Excel does not exist on the PC I cannot create this object.

Is there a way to modify a spreadsheet without Excel?

Answer: 
To use the code below, create an Excel workbook named "Test.xls" in the same folder as the vbscript file.

In Test.xls, enter the following data in cells A1 thru B4:

```
First   Last
Joe     Smith
Mary    Jones
Sam     Nelson

```

Paste the vbscript code below into a .vbs file:

```
Const adOpenStatic = 3
Const adLockOptimistic = 3

filename = "Test.xls"
Set cn = CreateObject("ADODB.Connection")
cn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & filename & _
        ";Extended Properties=Excel 8.0"

query = "Select * from [Sheet1$A1:B65535]"
Set rs = CreateObject("ADODB.Recordset")
rs.Open query, cn, adOpenStatic, adLockOptimistic

rs.AddNew
rs("First") = "George"
rs("Last") = "Washington"
rs.Update

rs.MoveFirst
Do Until rs.EOF
  WScript.Echo rs.Fields("First") & " " & rs.Fields("Last")
  rs.MoveNext
Loop

```

At a command prompt, type:

```
CSCRIPT Yourfile.vbs

```

It will add a name to the spreadsheet and then write out all the names.

```
Joe Smith
Mary Jones
Sam Nelson
George Washington

```
Without Excel installed I cannot see how you will be able to change an Excel document. 

However, If your are using Excel 2007 spreadsheets (xslx) then you should able to use the OpenXML functionality of the .NET Framework to update the contents without Excel physically being installed.

Take a look [here](http://www.microsoft.com/uk/msdn/screencasts/screencast/239/Intro-to-the-Office-Open-XML-File-Format.aspx) for more information on Office OpenXML.