スプレッドシートを作成する
このページでは、スプレッドシートを作成する方法について説明します。
例
スプレッドシートを作成するには、次の例に示すように、spreadsheets コレクションの create メソッドを使用します。
この例では、指定したタイトルの空のスプレッドシートを作成します。
Google ドライブのフォルダを操作する
Sheets API を使用して、指定したドライブ フォルダ内に直接スプレッドシートを作成するオプションはありません。デフォルトでは、作成されたスプレッドシートは、ドライブのユーザーのルートフォルダに保存されます。
ただし、ドライブ フォルダにファイルを保存する方法は他に 2 つあります。
どちらの方法でも、適切な Drive API スコープを追加して呼び出しを承認する必要があります。
共有ドライブ フォルダ内でファイルを移動または作成するには、共有ドライブのサポートを実装するをご覧ください。
Google スプレッドシートのセル数と行数の上限について詳しくは、Google ドライブに保存可能なファイルをご覧ください。
特に記載のない限り、このページのコンテンツはクリエイティブ・コモンズの表示 4.0 ライセンスにより使用許諾されます。コードサンプルは Apache 2.0 ライセンスにより使用許諾されます。詳しくは、Google Developers サイトのポリシーをご覧ください。Java は Oracle および関連会社の登録商標です。
最終更新日 2024-12-21 UTC。
[null,null,["最終更新日 2024-12-21 UTC。"],[[["This page provides code samples demonstrating how to create a blank Google Spreadsheet using the Sheets API in various programming languages."],["By default, new spreadsheets are created in the user's root Drive folder, requiring the Drive API to move them to a specific folder."],["You can alternatively create a blank spreadsheet directly within a folder using the Drive API, specifying the appropriate MIME type."],["Refer to the linked resources for information on Drive API scopes, shared drive support, and Google Sheets limitations."]]],["To create a spreadsheet, utilize the `spreadsheets.create` method, specifying the desired title within the `properties` field. This action generates a blank spreadsheet. By default, spreadsheets are saved in the user's root folder in Drive. To save to a specific folder, use the Drive API's `files.update` method to move it or `files.create` to directly add it to the folder. The examples given use `Apps Script`, `Java`, `Javascript`, `Node.js`, `PHP`, `Python`, and `Ruby`.\n"]]