Forum Discussion

Supa's avatar
Supa
New Contributor
16 years ago

How to write data in excel sheet using VB Script in TC 8

Hi All,



I know how to read the data from excel sheet columns using Excel drivers.

I want to write data in excel sheet columns? Please help me

1 Reply


  • Hello Patil,





    To write data to Excel sheets, you need to work with Excel's COM object. Here is an example:







    var xcl  = Sys.OleObject("Excel.Application");

    var workb = xcl.Workbooks.Add();

    xcl.Cells(1, 1) = "test";

    workb.SaveAs("C:\\test\\test.xls");

    workb.Close();







    You can find some additional information on how to work with Excel in the following help topics:

    Working With Microsoft Excel Files

    Working With Excel Files via COM