0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

GASでエクセルをスプレッドシートに変換する

Posted at

①変換したい複数のエクセルファイルをファイルに保存
②コード実行
③保存先のファイルにスプレッドシートが格納される。

※保存ファイルにPASSが設定されていると実行されないので
事前にPythonなどでPASSの解除が必要

function change() {
  /入金表/
  var dest_folder = DriveApp.getFolderById('エクセルファイルが保存されているフォルダのID');
  var source_folder = DriveApp.getFolderById('変換されたスプレッドシートを保存するフォルダのID');
  var excel_files = source_folder.getFiles();

  while (excel_files.hasNext()) {
    var file = excel_files.next();
    var options = {
      title: file.getName(),
      mimeType: MimeType.GOOGLE_SHEETS,
      parents: [{ id: dest_folder.getId() }]
    };
    Drive.Files.insert(options, file.getBlob());
  }
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?