I wrote a script that generates excel files. In those files, I add images inside cells. I set the width of the images cell by calculating the total images width.
Here is how it looks in MS Excel:
And here's how it looks in Google Sheets (same file):
As you can see, the width of the cell is smaller than the image in Google Docs, but in MS Excel it's the correct size.
Looking at she sheet1.xml
of the original file, I can see:
<cols>
<col min="1" max="1" width="10" customWidth="1"/>
<col min="2" max="2" width="10" customWidth="1"/>
<col min="3" max="3" width="12.1" customWidth="1"/>
<col min="4" max="4" width="20.050541516245488" customWidth="1"/>
<col min="5" max="5" width="10" customWidth="1"/>
<col min="6" max="6" width="14.3" customWidth="1"/>
</cols>
And in the new file (after uploading to google, I downloaded it as xlsx
) I see:
<cols>
<col customWidth="1" min="1" max="2" width="7.78"/>
<col customWidth="1" min="3" max="3" width="9.44"/>
<col customWidth="1" min="4" max="4" width="15.56"/>
<col customWidth="1" min="5" max="5" width="7.78"/>
<col customWidth="1" min="6" max="6" width="11.11"/>
<col customWidth="1" min="7" max="26" width="8.33"/>
</cols>
Google changed the column sizes. Why, and how can I solve this?
Links:
Best Answer
It's not possible.
The above is because
One workaround is to make another script that replicates what is done by the script that you use to creates the Excel but to create the Google Sheets spreadsheet.
Another workaround might be to use Google Apps Script to adjust the columns sizes.