Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Converting .xls to google spreadsheet in google apps script

I have an .xls file stored in Google Drive. I want to convert it to the Google Sheets spreadsheet file format from Google Apps Script. Is there any way to do this without external solutions?

like image 510
Buravchik Avatar asked Jul 27 '12 05:07

Buravchik


2 Answers

This is now possible using the Advanced Drive service:

https://developers.google.com/apps-script/advanced/drive

When using Drive.Files.insert, simply set the optional parameter "convert" to "true".

var file = {
    title: 'Converted Spreadsheet'
  };
  file = Drive.Files.insert(file, xlsxBlob, {
    convert: true
  });

This was also obtained from the above given issue

like image 154
Riyafa Abdul Hameed Avatar answered Oct 21 '22 23:10

Riyafa Abdul Hameed


Other than using the delivered 'upload' and convert functions, it's not currently available. Requesting enhancement request here: http://code.google.com/p/google-apps-script-issues/issues/detail?id=1019

like image 32
Joe Foley Avatar answered Oct 21 '22 22:10

Joe Foley