Replace sheet index with gid as it no longer seems to work. Needed for CSV export