在谷歌应用程序脚本中将 .xls 转换为谷歌电子表格 [英] Converting .xls to google spreadsheet in google apps script
本文介绍了在谷歌应用程序脚本中将 .xls 转换为谷歌电子表格的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在 Google 云端硬盘中存储了一个 .xls 文件.我想将它从 Google Apps Script 转换为 Google Sheets 电子表格文件格式.没有外部解决方案,有没有办法做到这一点?
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?
推荐答案
现在可以使用 Advanced Drive 服务:
This is now possible using the Advanced Drive service:
https://developers.google.com/apps-script/advanced/drive
使用 Drive.Files.insert 时,只需将可选参数convert"设置为true"即可.
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
});
这也是从上面给出的 问题
这篇关于在谷歌应用程序脚本中将 .xls 转换为谷歌电子表格的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文