# data reading and writng from/to excel using VBScript



## coool_03 (Dec 15, 2004)

hi, if I dont have Excel on my computer..can I still access xls files/data from other computer on netwrk where excel is installed. I have the VBScript code whic are running on systems where execl is installed...I want codes in VBScript which I can use to read/write/edit exls ffiles on a network...please help with the example code ..thanks you for all ur time. [email protected]


----------



## Gibbs (Feb 28, 2005)

Never used VBScript but this looks handy:


```
[size=2]<Script language="vbscript">

Dim objexcel

Set objExcel = server.createobject("Excel.application")

objexcel.Visible = True

objexcel.Workbooks.add

objexcel.Cells(1, 1).Value = "Testing"

objexcel.ActiveWorkbook.SaveAs("c:\exceltest.xls")
objexcel.Quit

</SCRIPT>[/size]
```


----------



## coool_03 (Dec 15, 2004)

Gibbs said:


> Never used VBScript but this looks handy:
> 
> 
> ```
> ...


 thank you for the code, Gibbs!!. However, I have the above code you have provided and have been using it. The above code works good only when MSExcel is installed on the computer.

Let me put my question once again. I want to use this code on a network. There are some computer which does not have Excell on it. If I use the above code, the error says "Cannot create Excel.Application object" because Excel is not installed on the computer. The above code seems to be ASP code...I cannot use ASP ...

I think I should use Connection objects, Recordset...please help.


----------

