Write a Large Array of Strings to a Worksheet

Writes the contents of an array into a range of spreadsheet cells.

 
 
 
 
 
(0)
Add to favorites
Office
8/10/2009
E-mail Twitter del.icio.us Digg Facebook
Sign in to ask a question


  • I tried but failed?
    2 Posts | Last post August 30, 2010
    • Hi,
      I just tried to enter an array int e new created excel worksheet in PowerShell:
          $NumLines = $all.count # all is my array to  be stored
          $xl = CreateObject("Excel.Application")
      ERROR 1
      The term 'CreateObject' is not recognized as the name of a cmdlet, function, script file, or operable program. Check
       the spelling of the name, or if a path was included, verify that the path is correct and try again.
      Bei Zeile:140 Zeichen:23
      +     $xl = CreateObject <<<< ("Excel.Application")
      
          $xl.visible = $true
          $x1
          $wb = xl.workbooks.add
      The term 'wb.Worksheets' is not recognized as the name of a cmdlet, function, script file, or operable program. Chec
      k the spelling of the name, or if a path was included, verify that the path is correct and try again.
      
      
      And now - of course - everything else fails:
          $wb
          $ws = wb.Worksheets(1)
          $ws
          $r = $("A1:P" + $NumLines) 
          $r     
          $ws.Range($r).Value = $all
      
      You wrote that it is powershell code - no?
    • he did but it's vb script