Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

ChangeSheet not doing anything for XLSX #60

Closed
osuwariboy opened this issue Jan 14, 2014 · 2 comments
Closed

ChangeSheet not doing anything for XLSX #60

osuwariboy opened this issue Jan 14, 2014 · 2 comments

Comments

@osuwariboy
Copy link

Hey there,

  When you open an XLSX file and call ChangeSheet as your first operation, ChangeSheet will not change the sheet. This is because of the following condition in the rewind method:

if ($this -> Index > 0 || !($this -> Worksheet instanceof XMLReader))

This is because, if you haven't done anything,

$this->Index is 0 and $this->Worksheet is indeed an instance of XMLReader since the first sheet was loaded. So to fix this, either unset $this->Worksheet or set $this->Index to 1 in the ChangeSheet method, this way, rewind will successfully load the correct worksheet when it's called.

martinsp-sales added a commit to martinsp-sales/spreadsheet-reader that referenced this issue Feb 4, 2014
@mephraums
Copy link

Thanks for attaching the fix, this has solved the issue for me.

@pilsetnieks
Copy link
Member

Thanks, this is fixed in v.0.5.8.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants