Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I need to read cells values from worksheet and i am referening folowing piece of code, however i don't get .Items() method

Code Refered: $objWorksheet.Cells.Item(2,1).Text

Also is there any other way we can read the cell values? Any suggestions/help would be highly appreciated

Regards, Ketan

share|improve this question
add comment

1 Answer

I belive it would be:

$VaribleObject = $objWorksheet.Cells.Item(2, 1).Value()

I hope this helps ;)

http://blogs.msdn.com/b/sriram_reddy1/archive/2012/07/16/excel-with-powershell.aspx

share|improve this answer
    
Done using same way..still giving error $excelObj = New-Object -ComObject "Excel.Application" $wrkBook = $excelObj.Workbooks.Open("FILE_PATH") $wrkShtGroup = $wrkBook.Worksheets.Item(4) $wrkShtGroup.Cells.Items(2,2).Value() –  Ketan03 Aug 17 '12 at 11:43
    
Hi that really strange! I dont really use poweshell meself but I fond this that should help! goto page 378. It goes into detail far more than I could as I dont know what code you might have thats effecting the result! hope it helps –  ali Sharepoint Aug 17 '12 at 12:59
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.