Converting .xls to google spreadsheet in google apps script

google apps script read excel
drive.files.insert google apps script
convert xlsx to google sheets
import excel file google script
import data from google sheets to excel
google drive script
google sheet link to csv
google sheets app

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?

This is now possible using the Advanced Drive service:

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

How to Convert Microsoft Excel to Google Spreadsheet Format with , Published in: Google Apps Script - Google Sheets. If your colleagues have been emailing you Microsoft Excel spreadsheets in xls or xlsx format  Google Apps Script for converting Excel (.xls or .xlsx) file to Google Spreadsheet. Drive API must be enabled in your script's Advanced Google Services and in Developers Console for the script

Other than using the delivered 'upload' and convert functions, it's not currently available. Requesting enhancement request here:

Converting .xls to google spreadsheet in google apps script, This is now possible using the Advanced Drive service:​.com/apps-script/advanced/drive. When using Drive. Tech, a la carte. You can easily convert any Google Spreadsheet or Google Document in your Google Drive to other formats like PDF, XLS, etc with Google Apps Script and either email the converted file or save it back to Google Drive.

Here's the complete code to create a file in a particular folder: (was a hint but was not completely apparent to me from @ben-visness comment)

var file = { 
    "title": filename, 
    "parents": [{"id": folderId}]
file = Drive.Files.insert(file, blobObj, {
    "convert": true

Note: This will require enabling advanced Drive service from within Google Apps Script - Menu > Resources > Advanced Google Services AND Menu > Resources > Advanced Google Services > Google API Console.

Convert Excel To Google Sheets - Here's How, Is there a way to convert Excel to Google Sheets? If your colleagues have been emailing you Microsoft Excel spreadsheets in xls or xlsx format, here’s a little snippet that will help you convert those Excel sheets into native Google Spreadsheet format using the Advanced Drive API service of Google Apps Script.

Authorization for Google Services | Apps Script, How do I use the script editor in Google Sheets? In this tutorial, I'm going to show you how to take an Excel spreadsheet and upload it to Google Drive, converting it to a Sheets-friendly file. Watch & Learn. Let's walk through converting spreadsheets in the screencast below. I'll show you how to upload a spreadsheet from Excel to Google Drive and convert it to a Sheets file.

How to import xlsx file from google drive into google sheets with script, or ask the Google Developer Experts (GDE) in the Google Apps Script  Google Apps Script lets you do new and cool things with Google Sheets. You can use Apps Script to add custom menus, dialogs, and sidebars to Google Sheets. It also lets you write custom functions for Sheets, as well as integrate Sheets with other Google services like Calendar, Drive, and Gmail.

convert xls to sheet - Docs Editors Community, That's great except my processes are designed around the fact that Google did not support them and automatically converted XLS to sheets. >> Convert Excel To Google Sheets – Here’s How If you are a Google Drive user and use Google Sheets for spreadsheets, you will inevitably have a situation where someone sends to an Excel file. In some cases you will want to just keep it as an XLS document and view/work with it that way.