Closed ByteToByte closed 8 years ago
@Effectik I'm sorry I don't really understand what you're asking. Are you asking about how to correctly loop over the worksheets if you don't know what the title of the worksheet is?
If so the code sample above does look correct. Calling '$worksheetFeed->getEntries()' will return an array of Worksheets, so using foreach as you have above is right.
foreach ($worksheetFeed->getEntries() as $worksheet) {
// $worksheet is a Worksheet object and you can call any methods on it, e.g. 'getListFeed()' and 'getCellFeed()'
}
Which line of code is throwing an exception? is it when you call getListFeed()?
@asimlqt Thx man, but not working Yes. If i call getListFeed() and if not found item on first worksheet then i get exception
foreach ($worksheetFeed->getEntries() as $worksheet) {
$worksheet->getListFeed(["sq" => "name=John", "reverse" => "true"]); throwing exception
}
Invalid column name - this error. I fixed in my table.
I try ... $spreadsheet = $spreadsheetFeed->getByTitle('table.xlsx'); $worksheetFeed = $spreadsheet->getWorksheetFeed(); $worksheets = $worksheetFeed->getEntries(); foreach($worksheets as $worksheet) { $worksheet->getListFeed(["sq" => "name=John", "reverse" => "true"]); } but i get unknown throw ex
How to correct loop syntax if don't know title's worksheet (You can loop over each worksheet using 'getEntries()') ? and update cell's with loop
If i use single by title $worksheet = $worksheetFeed->getByTitle('Sheet1'); then OK
Sry my eng poor. You understand me? Thx.