Forum Discussion

Raj27's avatar
Raj27
Occasional Contributor
8 years ago

how to upload values in Excel from test complete

I need to capture some values from the screen and to upload it in the Excel sheet.

6 Replies

    • Raj27's avatar
      Raj27
      Occasional Contributor

      thank you,   But I need to upload some values into the excel sheet that are fetched  from a windows application

      • altemann's avatar
        altemann
        Contributor

        Hey! Maybe something like this will help you:

         

        var values = [info coming from your app...];
        
        function TextExcel()
        {
          var excel = Sys.OleObject("Excel.Application"); excel.DisplayAlerts = false; //No messages
          var book = app.Workbooks.Open("C:\\EXCELFILE"); //Path to your excel file
          var sheet = book.Sheets("Plan1"); //Name of the sheet
        
          for (x = 0; x < values.length; x++) {
            sheet.Cells(1, x+1) = values[x];
          }
        
          book.Save();
          app.Quit();
        }