יצירת גיליון אלקטרוני
בדף הזה נסביר איך יוצרים גיליון אלקטרוני.
דוגמה
כדי ליצור גיליון אלקטרוני, משתמשים ב-method create באוסף spreadsheets, כפי שמתואר בדוגמה הבאה.
בדוגמה הזו נוצר גיליון אלקטרוני ריק עם כותרת שצוינה.
עבודה עם תיקיות ב-Google Drive
אי אפשר ליצור גיליון אלקטרוני ישירות בתיקייה ספציפית ב-Drive באמצעות Sheets API. כברירת מחדל, הגיליון האלקטרוני שנוצר נשמר בתיקיית השורש של המשתמש ב-Drive.
עם זאת, יש 2 חלופות לשמירת קובץ בתיקייה ב-Drive:
- אחרי שיוצרים את הגיליון האלקטרוני, מעבירים אותו לתיקייה ספציפית באמצעות השיטה files.update של Drive API. מידע נוסף על העברת קבצים זמין במאמר העברת קבצים בין תיקיות.
- מוסיפים גיליון אלקטרוני ריק לתיקייה באמצעות ה-method files.create של Drive API, ומציינים את
application/vnd.google-apps.spreadsheet
כ-mimeType
. מידע נוסף על יצירת קבצים זמין במאמר יצירת קובץ בתיקייה.
בכל אחת מהחלופות, תצטרכו להוסיף את היקפי הרשאה המתאימים של Drive API כדי לאשר את הקריאה.
כדי להעביר או ליצור קובץ בתיקייה באחסון שיתופי, אפשר לעיין במאמר הטמעת תמיכה באחסון שיתופי.
מידע נוסף על מגבלות של תאים ושורות ב-Google Sheets זמין במאמר קבצים שאפשר לאחסן ב-Google Drive.
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 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"]]