{"id":4337,"date":"2019-08-07T01:00:45","date_gmt":"2019-08-06T16:00:45","guid":{"rendered":"https:\/\/blog.capilano-fw.com\/?p=4337"},"modified":"2020-05-25T17:37:56","modified_gmt":"2020-05-25T08:37:56","slug":"%e3%80%90php%e3%80%91google-spreadsheet-api%ef%bc%88v4%ef%bc%89%e3%81%ae%e4%bd%bf%e3%81%84%e6%96%b9%e3%83%bb%e5%85%a825%e5%ae%9f%e4%be%8b%ef%bc%81","status":"publish","type":"post","link":"https:\/\/blog.capilano-fw.com\/?p=4337","title":{"rendered":"\u3010PHP\u3011Google spreadsheet API\uff08V4\uff09\u306e\u4f7f\u3044\u65b9\u30fb\u516825\u5b9f\u4f8b\uff01"},"content":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u3053\u306e\u9593 <a href=\"https:\/\/blog.capilano-fw.com\/?p=3945\">PhpSpreadsheet\u3067Excel\u3092\u64cd\u4f5c\u3059\u308b\u516826\u5b9f\u4f8b\uff01<\/a>\u3068\u3044\u3046\u8a18\u4e8b\u3092\u516c\u958b\u3057\u307e\u3057\u305f\u304c\u3001\u610f\u5916\u306b\u3082\u3053\u306e\u8a18\u4e8b\u3078\u306e\u30a2\u30af\u30bb\u30b9\u304c\u591a\u304b\u3063\u305f\u306e\u3067\u300c\u3084\u3063\u3071\u308aPHP\u3067Excel\u3092\u64cd\u4f5c\u3059\u308b\u9700\u8981\u3063\u3066\u591a\u3044\u3093\u3060\u306a\ud83d\ude0a\u300d\u3068\u8003\u3048\u3066\u3044\u307e\u3057\u305f\u3002<\/p>\n<p>\u3061\u306a\u307f\u306b\u3001\u79c1\u306f\u30d7\u30ed\u30b0\u30e9\u30e0\u958b\u767a\u306b\u90fd\u5408\u304c\u3044\u3044\u3053\u3068\u304c\u591a\u3044\u305f\u3081\u30e1\u30a4\u30f3\u306eOS\u306b\u306f<code>Linux<\/code>\u3092\u4f7f\u3063\u3066\u3044\u307e\u3059\u3002\u305d\u306e\u305f\u3081\u3001<code>Excel<\/code>\u306f<code>VirtualBox<\/code>\u5185\u306e<code>Windows<\/code>\u3067\u5b9f\u884c\u3059\u308b\u3088\u3046\u306b\u3057\u3066\u3044\u307e\u3059\u304c\u3001\u6b63\u76f4\u3044\u3061\u3044\u3061\u8d77\u52d5\u3059\u308b\u306e\u306f\u3081\u3093\u3069\u3046\u3060\u3063\u305f\u308a\u3082\u3057\u307e\u3059\u3002<\/p>\n<p>\u305d\u3053\u3067\u91cd\u5b9d\u3059\u308b\u306e\u304c\u300cGoogle\u7248Excel\u300d\u3068\u3044\u3046\u4f4d\u7f6e\u3065\u3051\u306e<strong>\u300cGoogle \u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u300d<\/strong>\u3067\u3059\u3002\u306a\u305c\u306a\u3089Google\u304c\u958b\u767a\u3057\u3066\u3044\u308b\u3060\u3051\u3042\u3063\u3066\u30d6\u30e9\u30a6\u30b6\u4e0a\u3067\u5b8c\u7d50\u3055\u305b\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u304b\u3089\u3067\u3059\u3002\uff08\u3057\u304b\u3082\u3001\u8a2d\u5b9a\u306b\u3088\u3063\u3066\u30aa\u30d5\u30e9\u30a4\u30f3\u3067\u306e\u7de8\u96c6\u3082\u3067\u304d\u308b\u3088\u3046\u3067\u3059\uff09<\/p>\n<p>\u305d\u3057\u3066\u3001\u4ee5\u524d <a href=\"https:\/\/blog.capilano-fw.com\/?p=1816\">Laravel \u3067\u6ce8\u6587\u30c7\u30fc\u30bf\u3092Google\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306b\u8ffd\u52a0\u3059\u308b<\/a>\u3068\u3044\u3046\u8a18\u4e8b\u3067\u306f<code>Google Sheet<\/code>\u306eAPI\u306b\u3064\u3044\u3066\u4e00\u90e8\u3092\u7d39\u4ecb\u3057\u307e\u3057\u305f\u304c\u3001\u307e\u3060\u4ed6\u306b\u3082\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u64cd\u4f5c\u3084\u30c7\u30fc\u30bf\u53d6\u5f97\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3053\u3068\u304c\u3042\u308b\u306e\u3067\u3001\u4eca\u56de\u306f\u5168\u4f53\u7684\u306b<code>Google Spreadsheet API<\/code>\u306e\u4f7f\u7528\u6cd5\u3092\u7d39\u4ecb\u3057\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u305c\u3072\u7686\u3055\u3093\u306e\u304a\u5f79\u306b\u7acb\u3066\u308b\u3068\u5b09\u3057\u3044\u3067\u3059\ud83d\ude0a\u2728<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3566 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_1.png\" alt=\"\" width=\"306\" height=\"320\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_1.png 306w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_1-287x300.png 287w\" sizes=\"auto, (max-width: 306px) 100vw, 306px\" \/>\u5b9f\u884c\u74b0\u5883\uff1a PHP 7.2<\/p>\n<h1>Google API\u306e\u6e96\u5099<\/h1>\n<p><code>Google Spreadsheet API<\/code>\u3092\u4f7f\u3046\u306b\u306f\u3001Google API \u30b3\u30f3\u30bd\u30fc\u30eb\u3067\u6709\u52b9\u306b\u3059\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u8a73\u3057\u3044\u5185\u5bb9\u306f <a href=\"https:\/\/blog.capilano-fw.com\/?p=1816\">Laravel \u3067\u6ce8\u6587\u30c7\u30fc\u30bf\u3092Google\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306b\u8ffd\u52a0\u3059\u308b<\/a>\u306e\u4ee5\u4e0b\u306e\u9805\u76ee\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<ul>\n<li><a href=\"https:\/\/blog.capilano-fw.com\/?p=1816#Google_API\"><span class=\"toc_number toc_depth_2\">2.1<\/span>\u00a0Google API\u3067\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u3092\u6709\u52b9\u306b\u3059\u308b<\/a><\/li>\n<li><a href=\"https:\/\/blog.capilano-fw.com\/?p=1816#i-3\"><span class=\"toc_number toc_depth_2\">2.2<\/span>\u00a0\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u3092\u3064\u304f\u308b<\/a><\/li>\n<li><a href=\"https:\/\/blog.capilano-fw.com\/?p=1816#Google_Client_Library\"><span class=\"toc_number toc_depth_2\">2.3<\/span>\u00a0Google Client Library\u3092\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b<\/a><\/li>\n<\/ul>\n<h1>Google Spreadsheet API\u306e\u57fa\u672c\u7684\u306a\u4f7f\u3044\u65b9<\/h1>\n<h2>\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u3092\u4f5c\u6210\uff08\u306f\u3058\u3081\u306b\u8aad\u3093\u3067\u304a\u3044\u3066\u304f\u3060\u3055\u3044\uff09<\/h2>\n<p><code>Google Spreadsheet API<\/code>\u306b\u9650\u3089\u305a\u3067\u3059\u304c\u3001PHP\u304b\u3089Google\u306eAPI\u3078\u30a2\u30af\u30bb\u30b9\u3059\u308b\u306b\u306f\u3001\u307e\u305a<code>Google_Client<\/code>\u3068\u3044\u3046\u30af\u30e9\u30b9\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u4f5c\u308a\u3001\u3053\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8API\u306a\u3069\u5404\u7a2e\u30af\u30e9\u30b9\u306b\u6e21\u3057\u3066\u30c7\u30fc\u30bf\u306e\u9001\u53d7\u4fe1\u3092\u3059\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p>\u4f8b\u3048\u3070\u4ee5\u4e0b\u306e\u4f8b\u306f\u3001<code>Google \u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8<\/code>\u3068<code>Google \u30c9\u30e9\u30a4\u30d6<\/code>\u306eAPI\u306b\u30a2\u30af\u30bb\u30b9\u304c\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308b\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306e\u4f5c\u308a\u65b9\u3067\u3059\u3002<\/p>\n<pre><strong>$credentials_path = '\uff08\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u305f\u8a8d\u8a3c\u7528JSON\u30d5\u30a1\u30a4\u30eb\u3078\u306e\u30d1\u30b9\uff09';<\/strong>\r\n<strong>$client = new \\Google_Client();<\/strong>\r\n<strong>$client-&gt;setScopes([<\/strong>\r\n<strong>    \\Google_Service_Sheets::SPREADSHEETS, \/\/ \u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8<\/strong>\r\n<strong>    \\Google_Service_Sheets::DRIVE, \/\/ \u30c9\u30e9\u30a4\u30d6<\/strong>\r\n<strong>]);<\/strong>\r\n<strong>$client-&gt;setAuthConfig($credentials_path);<\/strong><\/pre>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u3053\u3053\u304b\u3089\u306e\u8aac\u660e\u3067<code>$client<\/code>\u3068\u66f8\u3044\u3066\u3042\u308b\u5834\u5408\u306f\u3001\u4e0a\u8a18\u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u306e\u3053\u3068\u3092\u6307\u3057\u3066\u3044\u308b\u3068\u8003\u3048\u3066\u8aad\u307f\u9032\u3081\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h2>\u65b0\u3057\u3044\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u3092\u4f5c\u6210\u3059\u308b<\/h2>\n<p>\u5168\u304f\u65b0\u3057\u3044\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u3092\u4f5c\u6210\u3059\u308b\u306b\u306f\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b<code>create()<\/code>\u30e1\u30bd\u30c3\u30c9\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/p>\n<pre><strong>$spreadsheet_service = new \\Google_Service_Sheets($client);<\/strong>\r\n<strong>$requestBody = new \\Google_Service_Sheets_Spreadsheet([<\/strong>\r\n<strong>    'properties' =&gt; [<\/strong>\r\n<strong>        'title' =&gt; '\u65b0\u3057\u3044\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8'<\/strong>\r\n<strong>    ]<\/strong>\r\n<strong>]);<\/strong>\r\n<strong>$response = $spreadsheet_service-&gt;spreadsheets-&gt;create($requestBody);<\/strong>\r\n<strong>$spreadsheet_id = $response-&gt;spreadsheetId; \/\/ \u4f5c\u6210\u3055\u308c\u305f\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306eID<\/strong><\/pre>\n<p>\u3010\u6ce8\u610f\u3011<\/p>\n<p>\u305f\u3060\u3057\u3001\u3053\u306e\u4f8b\u3067<strong>\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u3092\u4f5c\u6210\u3057\u3066\u3082\u3001\u3042\u306a\u305f\u306eGoogle \u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306b\u306f\u8868\u793a\u306f\u3055\u308c\u307e\u305b\u3093\u3002<\/strong><\/p>\n<p>\u306a\u305c\u306a\u3089\u3001<strong>\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u3092\u4f5c\u6210\u3057\u305f\u306e\u306fAPI\u306e\u30c0\u30df\u30fc\u30e6\u30fc\u30b6\u30fc\u3060\u304b\u3089<\/strong>\u3067\u3059\u3002\uff08\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u305fJSON\u30d5\u30a1\u30a4\u30eb\u5185\u306b\u66f8\u304b\u308c\u3066\u3044\u308b\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\u304c\u3053\u306e\u30e6\u30fc\u30b6\u30fc\u306b\u5f53\u305f\u308a\u307e\u3059\uff09<\/p>\n<p>\u305d\u306e\u305f\u3081\u3001\u3082\u3057\u3042\u306a\u305f\u306e\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u304b\u3089\u3067\u3082\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\u3088\u3046\u306b\u3057\u305f\u3044\u5834\u5408\u306f\u3001<code>Google Drive API<\/code>\u3067\u6a29\u9650\u3092\u4e0e\u3048\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/blog.capilano-fw.com\/?p=1816\">Laravel \u3067\u6ce8\u6587\u30c7\u30fc\u30bf\u3092Google\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306b\u8ffd\u52a0\u3059\u308b<\/a> \u3092\u53c2\u8003\u306b\u3057\u3066<code>Google Drive API<\/code>\u3092\u6709\u52b9\u306b\u3057\u3001\u3055\u304d\u307b\u3069\u306e\u4f8b\u306e\u3088\u3046\u306b<strong>\u300c\\Google_Service_Sheets::DRIVE\u300d<\/strong>\u304c\u8ffd\u52a0\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u3092\u78ba\u8a8d\u3057\u3066\u3001\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u3092\u8ffd\u52a0\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<pre>$spreadsheet_id = $response-&gt;spreadsheetId; \/\/ \u4f5c\u6210\u3055\u308c\u305f\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306eID\r\n\r\n\/\/ \uff08\u3055\u3063\u304d\u306e\u7d9a\u304d\uff09\r\n\r\n<strong>$email = '\uff08\u6a29\u9650\u3092\u4e0e\u3048\u305f\u3044Google\u30e6\u30fc\u30b6\u30fc\u306e\u30e1\u30fc\u30eb\u30a2\u30c9\u30ec\u30b9\uff09';<\/strong>\r\n<strong>$drive_permission = new Google_Service_Drive_Permission();<\/strong>\r\n<strong>$drive_permission-&gt;setEmailAddress($email);<\/strong>\r\n<strong>$drive_permission-&gt;setType('user');<\/strong>\r\n<strong>$drive_permission-&gt;setRole('owner');<\/strong>\r\n\r\n<strong>$drive_service = new \\Google_Service_Drive($client);<\/strong>\r\n<strong>$drive_service-&gt;permissions-&gt;create($spreadsheet_id, $drive_permission, [<\/strong>\r\n<strong>    'transferOwnership' =&gt; 'true'   \/\/ \u30b3\u30d4\u30fc\u7b49\u306e\u6a29\u9650\u3042\u308a<\/strong>\r\n<strong>]);<\/strong><\/pre>\n<p>\u3053\u308c\u3067\u3001\u3042\u306a\u305f\u306e\u30a2\u30ab\u30a6\u30f3\u30c8\u304b\u3089\u4f5c\u6210\u3057\u305f\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306b\u30a2\u30af\u30bb\u30b9\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u306e\u3067\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30d6\u30e9\u30a6\u30b6\u4e0a\u304b\u3089\u3067\u3082\u78ba\u8a8d\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u306f\u305a\u3067\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4338\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/google_spreadsheet_7.png\" alt=\"\" width=\"269\" height=\"313\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/google_spreadsheet_7.png 269w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/google_spreadsheet_7-258x300.png 258w\" sizes=\"auto, (max-width: 269px) 100vw, 269px\" \/><\/p>\n<h2>\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u304b\u3089\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3059\u308b<\/h2>\n<h3>\u3072\u3068\u3064\u306e\u7bc4\u56f2\u304b\u3089\u3060\u3051\u53d6\u5f97<\/h3>\n<p>\u7d9a\u3044\u3066\u306f\u3001\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u304b\u3089\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3059\u308b\u65b9\u6cd5\u3067\u3059\u3002\u4f8b\u3048\u3070\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u308b\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u304b\u3089\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3057\u3066\u307f\u307e\u3057\u3087\u3046\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4339\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/google_spreadsheet_5.png\" alt=\"\" width=\"373\" height=\"149\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/google_spreadsheet_5.png 373w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/google_spreadsheet_5-300x120.png 300w\" sizes=\"auto, (max-width: 373px) 100vw, 373px\" \/><\/p>\n<pre><strong>$spreadsheet_service = new \\Google_Service_Sheets($client);<\/strong>\r\n\r\n<strong>$spreadsheet_id = '\uff08\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306eID\uff09';<\/strong>\r\n<strong>$range = 'Sheet1!A1:C5'; \/\/ \u53d6\u5f97\u3059\u308b\u7bc4\u56f2<\/strong>\r\n<strong>$response = $spreadsheet_service-&gt;spreadsheets_values-&gt;get($spreadsheet_id, $range);<\/strong>\r\n<strong>$values = $response-&gt;getValues();<\/strong>\r\n<strong>print_r($values);<\/strong><\/pre>\n<p>\u53d6\u5f97\u3067\u304d\u308b\u30c7\u30fc\u30bf\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306e\u914d\u5217\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre>Array\r\n(\r\n    [0] =&gt; Array\r\n        (\r\n            [0] =&gt; A1\r\n            [1] =&gt; B1\r\n            [2] =&gt; C1\r\n        )\r\n\r\n    [1] =&gt; Array\r\n        (\r\n            [0] =&gt; A2\r\n            [1] =&gt; B2\r\n            [2] =&gt; C2\r\n        )\r\n\r\n    [2] =&gt; Array\r\n        (\r\n            [0] =&gt; A3\r\n            [1] =&gt; B3\r\n            [2] =&gt; C3\r\n        )\r\n\r\n    [3] =&gt; Array\r\n        (\r\n            [0] =&gt; A4\r\n            [1] =&gt; B4\r\n            [2] =&gt; C4\r\n        )\r\n\r\n    [4] =&gt; Array\r\n        (\r\n            [0] =&gt; A5\r\n            [1] =&gt; B5\r\n            [2] =&gt; C5\r\n        )\r\n\r\n)\r\n<\/pre>\n<p>\u203b \u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306eID\u306e\u53d6\u5f97\u306f\u3001<a href=\"https:\/\/blog.capilano-fw.com\/?p=1816#ID\">\u4f5c\u6210\u3057\u305f\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306eID\u3092\u53d6\u5f97\u3059\u308b<\/a>\u3092\u53c2\u8003\u306b\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><code>$range<\/code>\u306e\u66f8\u5f0f\u306f\u6b21\u306e\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<pre><strong>\uff08\u30b7\u30fc\u30c8\u306e\u540d\u524d\uff09\uff01\uff08\u30bb\u30eb\u306e\u7bc4\u56f2\uff09<\/strong><\/pre>\n<p>\u30b7\u30fc\u30c8\u306e\u540d\u524d\u306f\u3001\u30d6\u30e9\u30a6\u30b6\u3067\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306b\u30a2\u30af\u30bb\u30b9\u3057\u3001\u753b\u9762\u5de6\u4e0b\u306b\u8868\u793a\u3055\u308c\u3066\u3044\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4342\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/google_spreadsheet_6.png\" alt=\"\" width=\"425\" height=\"73\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/google_spreadsheet_6.png 425w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/google_spreadsheet_6-300x52.png 300w\" sizes=\"auto, (max-width: 425px) 100vw, 425px\" \/><\/p>\n<p>\u305d\u306e\u305f\u3081\u3082\u3057\u30b7\u30fc\u30c8\u306e\u540d\u524d\u304c\u300c\u58f2\u4e0a\u7ba1\u7406\u300d\u3060\u3063\u305f\u5834\u5408\u306e\u7bc4\u56f2\u6307\u5b9a\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<pre><strong>$range = '\u58f2\u4e0a\u7ba1\u7406!A1:C5';<\/strong><\/pre>\n<p>\u306a\u304a\u3001\u5148\u307b\u3069\u306e\u4f8b\u3067\u306f\u3001\u884c\uff08\u304e\u3087\u3046\u3002\u6a2a\u65b9\u5411\uff09\u3092\u57fa\u6e96\u3068\u3057\u305f\u914d\u5217\u3067\u53d6\u5f97\u3057\u307e\u3057\u305f\u304c\u3001\u3053\u308c\u3092\u5217\uff08\u308c\u3064\u3002\u7e26\u65b9\u5411\uff09\u3092\u57fa\u6e96\u306b\u3057\u305f\u3044\u5834\u5408\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u6307\u5b9a\u3059\u308b\u3068\u3044\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n<pre>$spreadsheet_service = new \\Google_Service_Sheets($client);\r\n\r\n$spreadsheet_id = '\uff08\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306eID\uff09';\r\n$range = 'Sheet1!A1:C5';\r\n<strong>$options = [<\/strong>\r\n<strong>    'majorDimension' =&gt; 'COLUMNS'<\/strong>\r\n<strong>];<\/strong>\r\n$response = $spreadsheet_service-&gt;spreadsheets_values-&gt;get($spreadsheet_id, $range, <strong>$options<\/strong>);\r\n$values = $response-&gt;getValues();\r\nprint_r($values);<\/pre>\n<p>\u3053\u308c\u3092\u5b9f\u884c\u3059\u308b\u3068\u4ee5\u4e0b\u306e\u3088\u3046\u306b\uff08\uff15\u00d7\uff13\uff09\u306e\u914d\u5217\u306b\u306a\u308a\u307e\u3059\u3002\uff08\u5148\u307b\u3069\u306f\uff13\u00d7\uff15\uff09<\/p>\n<pre>Array\r\n(\r\n    [0] =&gt; Array\r\n        (\r\n            [0] =&gt; A1\r\n            [1] =&gt; A2\r\n            [2] =&gt; A3\r\n            [3] =&gt; A4\r\n            [4] =&gt; A5\r\n        )\r\n\r\n    [1] =&gt; Array\r\n        (\r\n            [0] =&gt; B1\r\n            [1] =&gt; B2\r\n            [2] =&gt; B3\r\n            [3] =&gt; B4\r\n            [4] =&gt; B5\r\n        )\r\n\r\n    [2] =&gt; Array\r\n        (\r\n            [0] =&gt; C1\r\n            [1] =&gt; C2\r\n            [2] =&gt; C3\r\n            [3] =&gt; C4\r\n            [4] =&gt; C5\r\n        )\r\n\r\n)<\/pre>\n<h3>\u8907\u6570\u306e\u7bc4\u56f2\u304b\u3089\u53d6\u5f97<\/h3>\n<p>\u4e00\u6c17\u306b\u8907\u6570\u306e\u7bc4\u56f2\u304b\u3089\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\u3059\u308b\u5834\u5408\u3067\u3059\u3002<\/p>\n<pre><strong>$spreadsheet_service = new \\Google_Service_Sheets($client);<\/strong>\r\n<strong>$spreadsheet_id = '\uff08\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306eID\uff09';<\/strong>\r\n<strong>$response = $spreadsheet_service-&gt;spreadsheets_values-&gt;batchGet(<\/strong>\r\n<strong>    $spreadsheet_id,<\/strong>\r\n<strong>    [<\/strong>\r\n<strong>        'ranges' =&gt; [<\/strong>\r\n<strong>            'Sheet1!A1:C5',<\/strong>\r\n<strong>            'Sheet2!A1:C3', \/\/ \u3044\u304f\u3064\u3067\u3082\u8ffd\u52a0\u3067\u304d\u307e\u3059<\/strong>\r\n<strong>        ]<\/strong>\r\n<strong>    ]<\/strong>\r\n<strong>);<\/strong>\r\n<strong>$value_ranges = $response-&gt;getValueRanges();<\/strong>\r\n\r\n<strong>foreach ($value_ranges as $value_range) {<\/strong>\r\n\r\n<strong>    print_r($value_range-&gt;getValues());<\/strong>\r\n\r\n<strong>}<\/strong><\/pre>\n<h2>\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306e\u30c7\u30fc\u30bf\u3092\u66f4\u65b0\u3059\u308b<\/h2>\n<h3 id=\"update_one\">\u3072\u3068\u3064\u306e\u7bc4\u56f2\u306e\u307f\u30c7\u30fc\u30bf\u66f4\u65b0\u3059\u308b<\/h3>\n<pre>try {\r\n\r\n    <strong>$values = [<\/strong>\r\n<strong>        [100, 1000, '=(A9+B9)', '\u30c6\u30b9\u30c8\u6587\u5b57\u5217', '2019-01-11'],<\/strong>\r\n<strong>        [200, 2000, '=(A10+B10)', '\u30c6\u30b9\u30c8\u6587\u5b57\u5217', '2019-01-12'],<\/strong>\r\n<strong>        [300, 3000, '=(A11+B11)', '\u30c6\u30b9\u30c8\u6587\u5b57\u5217', '2019-01-13'],<\/strong>\r\n<strong>    ];<\/strong>\r\n<strong>    $spreadsheet_service = new \\Google_Service_Sheets($client);<\/strong>\r\n<strong>    $spreadsheet_id = '\uff08\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306eID\uff09';<\/strong>\r\n<strong>    $range = 'Sheet1!A9:E11';<\/strong>\r\n<strong>    $body = new \\Google_Service_Sheets_ValueRange([<\/strong>\r\n<strong>        'values' =&gt; $values<\/strong>\r\n<strong>    ]);<\/strong>\r\n<strong>    $body-&gt;setValues($values);<\/strong>\r\n<strong>    $params = ['valueInputOption' =&gt; 'USER_ENTERED'];   \/\/ \u30c7\u30fc\u30bf\u306e\u5165\u529b\u65b9\u6cd5 \u203b<\/strong>\r\n<strong>    $result = $spreadsheet_service-&gt;spreadsheets_values-&gt;update(<\/strong>\r\n<strong>        $spreadsheet_id,<\/strong>\r\n<strong>        $range,<\/strong>\r\n<strong>        $body,<\/strong>\r\n<strong>        $params<\/strong>\r\n<strong>    );<\/strong>\r\n<strong>    echo $updated_cell_count = $result-&gt;getUpdatedCells();<\/strong>\r\n\r\n} catch (\\Exception $e) {\r\n\r\n    \/\/ \u30a8\u30e9\u30fc\u51e6\u7406\r\n\r\n}<\/pre>\n<p>\u203b \u30c7\u30fc\u30bf\u306e\u5165\u529b\u65b9\u6cd5\u306f\u4ee5\u4e0b\u306e\uff12\u3064\u3067\u3059\u3002<\/p>\n<p><strong>USER_ENTERED<\/strong><\/p>\n<p>\u30d6\u30e9\u30a6\u30b6\u3067\u30c7\u30fc\u30bf\u3092\u5165\u529b\u3059\u308b\u306e\u3068\u540c\u3058\u3002<br \/>\n\u3064\u307e\u308a\u3001\u8a08\u7b97\u5f0f\u3084\u65e5\u4ed8\u306f\u81ea\u52d5\u7684\u306b\u89e3\u91c8\u3055\u308c\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4350\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/google_spreadsheet_10.png\" alt=\"\" width=\"506\" height=\"64\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/google_spreadsheet_10.png 506w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/google_spreadsheet_10-300x38.png 300w\" sizes=\"auto, (max-width: 506px) 100vw, 506px\" \/><\/p>\n<p><strong>RAW<\/strong><\/p>\n<p>\u4e0a\u8a18\u306e\u89e3\u91c8\u3092\u3057\u306a\u3044\u3001\u3064\u307e\u308a\u305d\u306e\u307e\u307e\u306e\u72b6\u614b\u3067\u5165\u529b\u3057\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4351\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/google_spreadsheet_11.png\" alt=\"\" width=\"506\" height=\"64\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/google_spreadsheet_11.png 506w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/google_spreadsheet_11-300x38.png 300w\" sizes=\"auto, (max-width: 506px) 100vw, 506px\" \/><\/p>\n<h3>\u8907\u6570\u306e\u7bc4\u56f2\u3092\u30c7\u30fc\u30bf\u66f4\u65b0\u3059\u308b<\/h3>\n<p>\u4e00\u6c17\u306b\u8907\u6570\u306e\u30c7\u30fc\u30bf\u3092\u66f4\u65b0\u3059\u308b\u5834\u5408\u3067\u3059\u3002<\/p>\n<pre>try {\r\n\r\n    <strong>$spreadsheet_service = new \\Google_Service_Sheets($client);\r\n    $spreadsheet_id = '\uff08\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306eID\uff09';\r\n\r\n    $data = [];\r\n    $data[] = new \\Google_Service_Sheets_ValueRange([\r\n        'range' =&gt; 'Sheet1!A9:E9',\r\n        'values' =&gt; [\r\n            [100, 1000, '=(A9+B9)', '\u30c6\u30b9\u30c8\u6587\u5b57\u5217', '2019-01-11']\r\n        ]\r\n    ]);\r\n    $data[] = new \\Google_Service_Sheets_ValueRange([\r\n        'range' =&gt; 'Sheet1!A10:E10',\r\n        'values' =&gt; [\r\n            [200, 2000, '=(A9+B9)', '\u30c6\u30b9\u30c8\u6587\u5b57\u5217', '2019-01-12']\r\n        ]\r\n    ]);\r\n    $data[] = new \\Google_Service_Sheets_ValueRange([\r\n        'range' =&gt; 'Sheet1!A11:E11',\r\n        'values' =&gt; [[\r\n            300, 3000, '=(A9+B9)', '\u30c6\u30b9\u30c8\u6587\u5b57\u5217', '2019-01-13'\r\n        ]]\r\n    ]);\r\n\r\n    $body = new \\Google_Service_Sheets_BatchUpdateValuesRequest([\r\n        'valueInputOption' =&gt; 'USER_ENTERED',   \/\/ \u5165\u529b\u65b9\u6cd5 \u203b\r\n        'data' =&gt; $data\r\n    ]);\r\n    $result = $spreadsheet_service-&gt;spreadsheets_values-&gt;batchUpdate($spreadsheet_id, $body);\r\n    echo $updated_cell_count = $result-&gt;getTotalUpdatedCells();<\/strong>\r\n\r\n} catch (\\Exception $e) {\r\n\r\n    \/\/ \u30a8\u30e9\u30fc\u51e6\u7406\r\n\r\n}<\/pre>\n<p>\u203b \u5165\u529b\u65b9\u6cd5\u306f\u3001<a href=\"#update_one\">\u3072\u3068\u3064\u306e\u7bc4\u56f2\u306e\u307f\u30c7\u30fc\u30bf\u66f4\u65b0\u3059\u308b<\/a>\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h2>\u30c7\u30fc\u30bf\u3092\u6700\u7d42\u884c\u304b\u3089\u8ffd\u52a0\u3059\u308b<\/h2>\n<p>\u3042\u308b\u5834\u6240\u3092\u57fa\u6e96\u3068\u3057\u3066\u305d\u3053\u304b\u3089\u9806\u306b\u30c7\u30fc\u30bf\u3092\u8ffd\u52a0\u3059\u308b\u5834\u5408\u3067\u3059\u3002<\/p>\n<p>\u3064\u307e\u308a\u3001\u4f8b\u3048\u3070\u57fa\u6e96\u5834\u6240\u3092\u300cA9\u300d\u306b\u6307\u5b9a\u3057\u305f\u3051\u308c\u3069\u3059\u3067\u306b\u30c7\u30fc\u30bf\u304c\u5b58\u5728\u3057\u3066\u3044\u308b\u3088\u3046\u306a\u5834\u5408\u3092\u898b\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4354\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/google_spreadsheet_12.png\" alt=\"\" width=\"147\" height=\"64\" \/><\/p>\n<p>\u3053\u306e\u5834\u5408\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u305d\u308c\u4ee5\u964d\u306e\u5834\u6240\u304b\u3089\u30c7\u30fc\u30bf\u8ffd\u52a0\u3055\u308c\u308b\u3053\u3068\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4353\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/google_spreadsheet_13.png\" alt=\"\" width=\"372\" height=\"127\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/google_spreadsheet_13.png 372w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/google_spreadsheet_13-300x102.png 300w\" sizes=\"auto, (max-width: 372px) 100vw, 372px\" \/><\/p>\n<pre>try {\r\n\r\n    <strong>$values = [<\/strong>\r\n<strong>        [100, 1000, 10000],<\/strong>\r\n<strong>        [200, 2000, 10000],<\/strong>\r\n<strong>        [300, 3000, 10000],<\/strong>\r\n<strong>    ];<\/strong>\r\n<strong>    $spreadsheet_service = new \\Google_Service_Sheets($client);<\/strong>\r\n<strong>    $spreadsheet_id = '\uff08\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306eID\uff09';<\/strong>\r\n<strong>    $range = 'Sheet1!A9';<\/strong>\r\n<strong>    $body = new \\Google_Service_Sheets_ValueRange([<\/strong>\r\n<strong>        'values' =&gt; $values<\/strong>\r\n<strong>    ]);<\/strong>\r\n<strong>    $params = ['valueInputOption' =&gt; 'USER_ENTERED'];   \/\/ \u5165\u529b\u65b9\u6cd5 \u203b<\/strong>\r\n<strong>    $result = $spreadsheet_service-&gt;spreadsheets_values-&gt;append($spreadsheet_id, $range, $body, $params);<\/strong>\r\n<strong>    echo $updated_cell_count = $result-&gt;getUpdates()-&gt;getUpdatedCells();<\/strong>\r\n\r\n} catch (\\Exception $e) {\r\n\r\n    \/\/ \u30a8\u30e9\u30fc\u51e6\u7406\r\n\r\n}<\/pre>\n<p>\u203b \u5165\u529b\u65b9\u6cd5\u306f\u3001<a href=\"#update_one\">\u3072\u3068\u3064\u306e\u7bc4\u56f2\u306e\u307f\u30c7\u30fc\u30bf\u66f4\u65b0\u3059\u308b<\/a>\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h1>\u5404\u30b7\u30fc\u30c8\u3092\u64cd\u4f5c\u3059\u308b\u65b9\u6cd5<\/h1>\n<h2>\u65b0\u3057\u3044\u300c\u30b7\u30fc\u30c8\u300d\u3092\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306b\u8ffd\u52a0\u3059\u308b<\/h2>\n<p>\u3064\u307e\u308a\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u65b0\u3057\u3044\u30b7\u30fc\u30c8\u3092\u8ffd\u52a0\u3057\u305f\u3044\u5834\u5408\u3067\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4345\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/google_spreadsheet_8-1.png\" alt=\"\" width=\"374\" height=\"64\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/google_spreadsheet_8-1.png 374w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/google_spreadsheet_8-1-300x51.png 300w\" sizes=\"auto, (max-width: 374px) 100vw, 374px\" \/><\/p>\n<pre>try {\r\n\r\n    <strong>$spreadsheet_service = new \\Google_Service_Sheets($client);<\/strong>\r\n<strong>    $spreadsheet_id = '\uff08\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306eID\uff09';<\/strong>\r\n<strong>    $body = new \\Google_Service_Sheets_BatchUpdateSpreadsheetRequest([<\/strong>\r\n<strong>        'requests' =&gt; [<\/strong>\r\n<strong>            'addSheet' =&gt; [<\/strong>\r\n<strong>                'properties' =&gt; [<\/strong>\r\n<strong>                    'title' =&gt; '\u65b0\u3057\u3044\u30b7\u30fc\u30c8'<\/strong>\r\n<strong>                ]<\/strong>\r\n<strong>            ]<\/strong>\r\n<strong>        ]<\/strong>\r\n<strong>    ]);<\/strong>\r\n<strong>    $response = $spreadsheet_service-&gt;spreadsheets-&gt;batchUpdate($spreadsheet_id, $body);<\/strong>\r\n<strong>    $new_sheet_id = $response-&gt;getReplies()[0]<\/strong>\r\n<strong>        -&gt;getAddSheet()<\/strong>\r\n<strong>        -&gt;getProperties()<\/strong>\r\n<strong>        -&gt;sheetId;<\/strong>\r\n<strong>    echo($new_sheet_id);<\/strong>\r\n\r\n} catch (\\Exception $e) {\r\n\r\n    \/\/ \u30a8\u30e9\u30fc\u51e6\u7406\r\n\r\n}<\/pre>\n<h2>\u30b7\u30fc\u30c8\u306e\u5185\u5bb9\u3092\u30af\u30ea\u30a2\u3059\u308b<\/h2>\n<p>\u4f8b\u3048\u3070\u3001\u3042\u308b\u7279\u5b9a\u306e\u30b7\u30fc\u30c8\u306b\u4fdd\u5b58\u3055\u308c\u3066\u3044\u308b\u5168\u30c7\u30fc\u30bf\u3092\u30af\u30ea\u30a2\u3057\u305f\u3044\u5834\u5408\u3067\u3059\u3002<\/p>\n<pre><strong>try {<\/strong>\r\n\r\n<strong>    $spreadsheet_service = new \\Google_Service_Sheets($client);<\/strong>\r\n<strong>    $spreadsheet_id = '\uff08\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306eID\uff09';<\/strong>\r\n<strong>    $body = new \\Google_Service_Sheets_BatchUpdateSpreadsheetRequest([<\/strong>\r\n<strong>        'requests' =&gt; [<\/strong>\r\n<strong>            'updateCells' =&gt; [<\/strong>\r\n<strong>                'range' =&gt; [<\/strong>\r\n<strong>                    'sheetId' =&gt; '\uff08\u30b7\u30fc\u30c8\u306eID \u203b\uff09'<\/strong>\r\n<strong>                ],<\/strong>\r\n<strong>                'fields' =&gt; 'userEnteredValue,userEnteredFormat' \/\/ \u30c7\u30fc\u30bf\uff06\u30bb\u30eb\u306e\u88c5\u98fe\u3092\u30af\u30ea\u30a2<\/strong>\r\n<strong>            ]<\/strong>\r\n<strong>        ]<\/strong>\r\n<strong>    ]);<\/strong>\r\n<strong>    $spreadsheet_service-&gt;spreadsheets-&gt;batchUpdate($spreadsheet_id, $body);<\/strong>\r\n\r\n<strong>} catch (\\Exception $e) {<\/strong>\r\n\r\n<strong>    \/\/ \u30a8\u30e9\u30fc\u51e6\u7406<\/strong>\r\n\r\n<strong>}<\/strong><\/pre>\n<p>\u203b \u30b7\u30fc\u30c8\u306eID\u306f\u3001\u30b7\u30fc\u30c8\u306e\u540d\u524d\u3067\u306f\u306a\u304fID\u3067\u3059\u3002\u30b7\u30fc\u30c8ID\u3092\u53d6\u5f97\u3059\u308b\u65b9\u6cd5\u306f\u3001<a href=\"#sheets_info\">\u30b7\u30fc\u30c8\u306e\u60c5\u5831\u3092\u53d6\u5f97\u3059\u308b<\/a>\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<h2 id=\"sheets_info\">\u30b7\u30fc\u30c8\u306e\u60c5\u5831\u3092\u53d6\u5f97\u3059\u308b<\/h2>\n<p>\u4f8b\u3048\u3070\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30b7\u30fc\u30c8\u306e\u540d\u524d\u3084ID\u3092\u53d6\u5f97\u3057\u305f\u3044\u5834\u5408\u3067\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4342\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/google_spreadsheet_6.png\" alt=\"\" width=\"425\" height=\"73\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/google_spreadsheet_6.png 425w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/google_spreadsheet_6-300x52.png 300w\" sizes=\"auto, (max-width: 425px) 100vw, 425px\" \/><\/p>\n<pre><strong>$spreadsheet_service = new \\Google_Service_Sheets($client);<\/strong>\r\n<strong>$spreadsheet_id = '\uff08\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306eID\uff09';<\/strong>\r\n<strong>$response = $spreadsheet_service-&gt;spreadsheets-&gt;get($spreadsheet_id);<\/strong>\r\n<strong>$sheets = $response-&gt;getSheets();<\/strong>\r\n\r\n<strong>foreach ($sheets as $sheet) {<\/strong>\r\n\r\n<strong>    $properties = $sheet-&gt;getProperties();<\/strong>\r\n<strong>    $sheet_id = $properties-&gt;getSheetId();  \/\/ \u30b7\u30fc\u30c8ID<\/strong>\r\n<strong>    $sheet_title = $properties-&gt;getTitle(); \/\/ \u30b7\u30fc\u30c8\u306e\u540d\u524d<\/strong>\r\n<strong>    $sheet_index = $properties-&gt;getIndex(); \/\/ \u30b7\u30fc\u30c8\u306e\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\uff080, 1, 2...\uff09<\/strong>\r\n\r\n<strong>}<\/strong><\/pre>\n<h2>\u30b7\u30fc\u30c8\u3092\u5225\u306e\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306b\u30b3\u30d4\u30fc\u3059\u308b<\/h2>\n<p>\u4f8b\u3048\u3070\u3001\u300c\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8A\u30fb\u30b7\u30fc\u30c8\uff11\u300d\u3092\u300c\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8B\u300d\u306b\u30b3\u30d4\u30fc\u3057\u3066\u8ffd\u52a0\u3059\u308b\u5834\u5408\u3067\u3059\u3002<\/p>\n<pre><strong>$spreadsheet_service = new \\Google_Service_Sheets($client);<\/strong>\r\n<strong>$original_spreadsheet_id = '\uff08\u30b3\u30d4\u30fc\u5143\u306e\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8ID\uff09';<\/strong>\r\n<strong>$original_sheet_id = '\uff08\u30b3\u30d4\u30fc\u5143\u306e\u30b7\u30fc\u30c8ID\uff09';<\/strong>\r\n\r\n<strong>$new_spreadsheet_id = '\uff08\u30b3\u30d4\u30fc\u5148\u306e\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8ID\uff09';<\/strong>\r\n<strong>$new_spreadsheet = new \\Google_Service_Sheets_CopySheetToAnotherSpreadsheetRequest();<\/strong>\r\n<strong>$new_spreadsheet-&gt;setDestinationSpreadsheetId($new_spreadsheet_id);<\/strong>\r\n\r\n<strong>$response = $spreadsheet_service-&gt;spreadsheets_sheets<\/strong>\r\n<strong>    -&gt;copyTo(<\/strong>\r\n<strong>        $original_spreadsheet_id,<\/strong>\r\n<strong>        $original_sheet_id,<\/strong>\r\n<strong>        $new_spreadsheet<\/strong>\r\n<strong>    );<\/strong>\r\n<strong>echo $new_sheet_id = $response-&gt;getSheetId(); \/\/ \u4f5c\u6210\u3055\u308c\u305f\u30b7\u30fc\u30c8\u306eID<\/strong><\/pre>\n<p>\u203b \u3061\u306a\u307f\u306b\u3001\u30b3\u30d4\u30fc\u3092\u5b9f\u884c\u3059\u308b\u306b\u306f\u30b5\u30fc\u30d3\u30b9\u30a2\u30ab\u30a6\u30f3\u30c8\uff08API\u304c\u4f7f\u3046\u30c0\u30df\u30fc\u306e\u30e6\u30fc\u30b6\u30fc\uff09\u304c\u30b3\u30d4\u30fc\u306e\u6a29\u9650\u3092\u6301\u3063\u3066\u3044\u308b\u5fc5\u8981\u304c\u3042\u308a\u307e\u3059\u3002\u305d\u306e\u305f\u3081\u3001\u5168\u3066\u30d7\u30ed\u30b0\u30e9\u30e0\u4e0a\u3067\u5b9f\u884c\u3059\u308b\u5834\u5408\u306f<code>transferOwnership<\/code>\u3092<code>true<\/code>\u306b\u3057\u3066\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u3092\u4f5c\u6210\u3059\u308b\u3068\u3044\u3044\u3067\u3057\u3087\u3046\u3002<\/p>\n<p>\u30b3\u30d4\u30fc\u304c\u6210\u529f\u3059\u308b\u3068\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4346\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/google_spreadsheet_9.png\" alt=\"\" width=\"392\" height=\"70\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/google_spreadsheet_9.png 392w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/google_spreadsheet_9-300x54.png 300w\" sizes=\"auto, (max-width: 392px) 100vw, 392px\" \/><\/p>\n<h2>\u30b7\u30fc\u30c8\u3092\u524a\u9664\u3059\u308b<\/h2>\n<p>\u7279\u5b9a\u306e\u30b7\u30fc\u30c8\u3092\u524a\u9664\u3059\u308b\u5834\u5408\u3067\u3059\u3002<\/p>\n<pre>try {\r\n\r\n    <strong>$spreadsheet_service = new \\Google_Service_Sheets($client);<\/strong>\r\n<strong>    $spreadsheet_id = '\uff08\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306eID\uff09';<\/strong>\r\n<strong>    $sheet_id = '\uff08\u524a\u9664\u3059\u308b\u30b7\u30fc\u30c8\u306eID\uff09';<\/strong>\r\n<strong>    $body = new \\Google_Service_Sheets_BatchUpdateSpreadsheetRequest([<\/strong>\r\n<strong>        'requests' =&gt; [<\/strong>\r\n<strong>            'deleteSheet' =&gt; [<\/strong>\r\n<strong>                'sheetId' =&gt; $sheet_id<\/strong>\r\n<strong>            ]<\/strong>\r\n<strong>        ]<\/strong>\r\n<strong>    ]);<\/strong>\r\n<strong>    $response = $spreadsheet_service-&gt;spreadsheets-&gt;batchUpdate($spreadsheet_id, $body);<\/strong>\r\n\r\n} catch (\\Exception $e) {\r\n\r\n    \/\/ \u30a8\u30e9\u30fc\u51e6\u7406\r\n\r\n}<\/pre>\n<h1>\u30bb\u30eb\u3092\u88c5\u98fe\u3059\u308b<\/h1>\n<h2 id=\"decorate_cell\">\u30bb\u30eb\u3092\u88c5\u98fe\u3059\u308b\u57fa\u672c<\/h2>\n<p><code>Google Spreadsheet API<\/code>\u3067\u306f\u30bb\u30eb\u306e\u88c5\u98fe\u306f\u30bb\u30eb\u5185\u306e\u30c7\u30fc\u30bf\u66f4\u65b0\u3068\u540c\u3058\u304f<code>batchUpdate()<\/code>\u3092\u4f7f\u3063\u3066\u884c\u3044\u307e\u3059\u3002\u3064\u307e\u308a\u3001\u30ea\u30af\u30a8\u30b9\u30c8\u3059\u308b\u5185\u5bb9\u3092\u5909\u66f4\u3059\u308b\u3060\u3051\u3067\u80cc\u666f\u8272\u3084\u30c6\u30ad\u30b9\u30c8\u306e\u8272\u3001\u67a0\u7dda\u306a\u3069\u3092\u5909\u66f4\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3068\u3044\u3046\u308f\u3051\u3067\u3059\u3002<\/p>\n<p>\u4ee5\u4e0b\u306f\u3001\u305d\u306e\u57fa\u672c\u3068\u306a\u308b\u30b3\u30fc\u30c9\u3067\u3059\u3002\uff08\u203b \u4ee5\u964d\u306e\u8aac\u660e\u3067\u306f<code>$request_data<\/code>\u306e\u90e8\u5206\u306e\u307f\u3092\u7d39\u4ecb\u3057\u307e\u3059\uff09<\/p>\n<pre>try {\r\n\r\n    <strong>$spreadsheet_service = new \\Google_Service_Sheets($client);<\/strong>\r\n<strong>    $spreadsheet_id = '\uff08\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306eID\uff09';<\/strong>\r\n\r\n<strong>    \/\/ \u30ea\u30af\u30a8\u30b9\u30c8\u30c7\u30fc\u30bf<\/strong>\r\n<strong>    $request_data = [<\/strong>\r\n<strong>        \/\/ \u5404\u7a2e\u3053\u306e\u90e8\u5206\u3092\u5909\u66f4\u3059\u308b\u3053\u3068\u3067\u80cc\u666f\u8272\u3084\u67a0\u7dda\u306a\u3069\u3092\u5909\u66f4\u3067\u304d\u307e\u3059<\/strong>\r\n<strong>    ];<\/strong>\r\n\r\n<strong>    $requests = [new \\Google_Service_Sheets_Request($request_data)];<\/strong>\r\n<strong>    $batchUpdateRequest = new \\Google_Service_Sheets_BatchUpdateSpreadsheetRequest([<\/strong>\r\n<strong>        'requests' =&gt; $requests<\/strong>\r\n<strong>    ]);<\/strong>\r\n<strong>    $response = $spreadsheet_service-&gt;spreadsheets-&gt;batchUpdate($spreadsheet_id, $batchUpdateRequest);<\/strong>\r\n<strong>    print_r($response-&gt;getReplies());<\/strong>\r\n\r\n} catch (\\Exception $e) {\r\n\r\n    \/\/ \u30a8\u30e9\u30fc\u51e6\u7406\r\n\r\n}<\/pre>\n<h2>\u80cc\u666f\u8272\u3092\u3064\u3051\u308b<\/h2>\n<p>\u4f8b\u3048\u3070\u3001\u3042\u308b\u7bc4\u56f2\u306e\u80cc\u666f\u8272\u3092\u30d4\u30f3\u30af\u306b\u5909\u66f4\u3059\u308b\u5834\u5408\u3067\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4357\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/google_spreadsheet_14.png\" alt=\"\" width=\"580\" height=\"256\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/google_spreadsheet_14.png 580w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/google_spreadsheet_14-300x132.png 300w\" sizes=\"auto, (max-width: 580px) 100vw, 580px\" \/><\/p>\n<pre><strong>$request_data = [<\/strong>\r\n<strong>    'repeatCell' =&gt; [<\/strong>\r\n<strong>        'fields' =&gt; 'userEnteredFormat(backgroundColor)',<\/strong>\r\n<strong>        'range' =&gt; [<\/strong>\r\n<strong>            'sheetId' =&gt; '\uff08\u30b7\u30fc\u30c8\u306eID\uff09',<\/strong>\r\n<strong>            'startRowIndex' =&gt; 0,       \/\/ \u884c\u306e\u958b\u59cb\u4f4d\u7f6e<\/strong>\r\n<strong>            'endRowIndex' =&gt; 10,        \/\/ \u884c\u306e\u7d42\u4e86\u4f4d\u7f6e<\/strong>\r\n<strong>            'startColumnIndex' =&gt; 0,    \/\/ \u5217\u306e\u958b\u59cb\u4f4d\u7f6e<\/strong>\r\n<strong>            'endColumnIndex' =&gt; 5,      \/\/ \u5217\u306e\u7d42\u4e86\u4f4d\u7f6e<\/strong>\r\n<strong>        ],<\/strong>\r\n<strong>        'cell' =&gt; [<\/strong>\r\n<strong>            'userEnteredFormat' =&gt; [<\/strong>\r\n<strong>                'backgroundColor' =&gt; [  \/\/ \u8272\u306fRGB\u5f62\u5f0f<\/strong>\r\n<strong>                    'red' =&gt; 234\/255,<\/strong>\r\n<strong>                    'green' =&gt; 143\/255,<\/strong>\r\n<strong>                    'blue' =&gt; 143\/255<\/strong>\r\n<strong>                ]<\/strong>\r\n<strong>            ],<\/strong>\r\n<strong>        ],<\/strong>\r\n<strong>    ],<\/strong>\r\n<strong>];<\/strong><\/pre>\n<h2>\u30c6\u30ad\u30b9\u30c8\u306e\u8272\u3092\u5909\u3048\u308b<\/h2>\n<p>\u4f8b\u3048\u3070\u3001\u3042\u308b\u7bc4\u56f2\u306e\u30c6\u30ad\u30b9\u30c8\u8272\u3092\u8d64\u306b\u5909\u66f4\u3059\u308b\u5834\u5408\u3067\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4358\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/google_spreadsheet_15.png\" alt=\"\" width=\"595\" height=\"235\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/google_spreadsheet_15.png 595w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/google_spreadsheet_15-300x118.png 300w\" sizes=\"auto, (max-width: 595px) 100vw, 595px\" \/><\/p>\n<pre><strong>$request_data = [<\/strong>\r\n<strong>    'repeatCell' =&gt; [<\/strong>\r\n<strong>        'fields' =&gt; 'userEnteredFormat(textFormat)',<\/strong>\r\n<strong>        'range' =&gt; [<\/strong>\r\n<strong>            'sheetId' =&gt; '\uff08\u30b7\u30fc\u30c8\u306eID\uff09',<\/strong>\r\n<strong>            'startRowIndex' =&gt; 0,       \/\/ \u884c\u306e\u958b\u59cb\u4f4d\u7f6e<\/strong>\r\n<strong>            'endRowIndex' =&gt; 10,        \/\/ \u884c\u306e\u7d42\u4e86\u4f4d\u7f6e<\/strong>\r\n<strong>            'startColumnIndex' =&gt; 0,    \/\/ \u5217\u306e\u958b\u59cb\u4f4d\u7f6e<\/strong>\r\n<strong>            'endColumnIndex' =&gt; 5,      \/\/ \u5217\u306e\u7d42\u4e86\u4f4d\u7f6e<\/strong>\r\n<strong>        ],<\/strong>\r\n<strong>        'cell' =&gt; [<\/strong>\r\n<strong>            'userEnteredFormat' =&gt; [<\/strong>\r\n<strong>                'textFormat' =&gt; [<\/strong>\r\n<strong>                    'foregroundColor' =&gt; [  \/\/ \u8272\u306fRGB\u5f62\u5f0f<\/strong>\r\n<strong>                        'red' =&gt; 200\/255,<\/strong>\r\n<strong>                        'green' =&gt; 10\/255,<\/strong>\r\n<strong>                        'blue' =&gt; 25\/255<\/strong>\r\n<strong>                    ]<\/strong>\r\n<strong>                ]<\/strong>\r\n<strong>            ],<\/strong>\r\n<strong>        ],<\/strong>\r\n<strong>    ],<\/strong>\r\n<strong>];<\/strong><\/pre>\n<h2>\u30c6\u30ad\u30b9\u30c8\u306e\u53f3\u5bc4\u305b\u3001\u4e2d\u592e\u5bc4\u305b\u3001\u5de6\u5bc4\u305b\u3092\u6307\u5b9a\u3059\u308b<\/h2>\n<p>\u4f8b\u3048\u3070\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u8868\u793a\u30c6\u30ad\u30b9\u30c8\u3092\u300c\u5de6\u300d\u300c\u4e2d\u592e\u300d\u300c\u53f3\u300d\u306b\u5bc4\u305b\u308b\u5834\u5408\u3067\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4359\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/google_spreadsheet_16.png\" alt=\"\" width=\"349\" height=\"46\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/google_spreadsheet_16.png 349w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/google_spreadsheet_16-300x40.png 300w\" sizes=\"auto, (max-width: 349px) 100vw, 349px\" \/><\/p>\n<pre><strong>$request_data = [<\/strong>\r\n<strong>    'repeatCell' =&gt; [<\/strong>\r\n<strong>        'fields' =&gt; 'userEnteredFormat(horizontalAlignment)',<\/strong>\r\n<strong>        'range' =&gt; [<\/strong>\r\n<strong>            'sheetId' =&gt; '\uff08\u30b7\u30fc\u30c8ID\uff09',<\/strong>\r\n<strong>            'startRowIndex' =&gt; 0,       \/\/ \u884c\u306e\u958b\u59cb\u4f4d\u7f6e<\/strong>\r\n<strong>            'endRowIndex' =&gt; 1,         \/\/ \u884c\u306e\u7d42\u4e86\u4f4d\u7f6e<\/strong>\r\n<strong>            'startColumnIndex' =&gt; 0,    \/\/ \u5217\u306e\u958b\u59cb\u4f4d\u7f6e<\/strong>\r\n<strong>            'endColumnIndex' =&gt; 1,      \/\/ \u5217\u306e\u7d42\u4e86\u4f4d\u7f6e<\/strong>\r\n<strong>        ],<\/strong>\r\n<strong>        'cell' =&gt; [<\/strong>\r\n<strong>            'userEnteredFormat' =&gt; [<\/strong>\r\n<strong>                'horizontalAlignment' =&gt; 'CENTER'   \/\/ \u4f4d\u7f6e\u306e\u30d1\u30e9\u30e1\u30fc\u30bf \u203b<\/strong>\r\n<strong>            ],<\/strong>\r\n<strong>        ],<\/strong>\r\n<strong>    ],<\/strong>\r\n<strong>];<\/strong><\/pre>\n<p>\u4f4d\u7f6e\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u306f\u4ee5\u4e0b\u306e\u3068\u304a\u308a\u3067\u3059\u3002<\/p>\n<ul>\n<li>LEFT\u3000\u30fb\u30fb\u30fb\u3000\u5de6\u5bc4\u305b<\/li>\n<li>CENTER\u3000\u30fb\u30fb\u30fb\u3000\u4e2d\u592e\u5bc4\u305b<\/li>\n<li>RIGHT\u3000\u30fb\u30fb\u30fb\u3000\u53f3\u5bc4\u305b<\/li>\n<\/ul>\n<h2>\u30c6\u30ad\u30b9\u30c8\u3092\u592a\u5b57\u306b\u3059\u308b<\/h2>\n<p>\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30c6\u30ad\u30b9\u30c8\u3092\u592a\u5b57\u306b\u3059\u308b\u5834\u5408\u3067\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4360\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/google_spreadsheet_17.png\" alt=\"\" width=\"248\" height=\"46\" \/><\/p>\n<pre><strong>$request_data = [<\/strong>\r\n<strong>    'repeatCell' =&gt; [<\/strong>\r\n<strong>        'fields' =&gt; 'userEnteredFormat(textFormat)',<\/strong>\r\n<strong>        'range' =&gt; [<\/strong>\r\n<strong>            'sheetId' =&gt; '\uff08\u30b7\u30fc\u30c8ID\uff09',<\/strong>\r\n<strong>            'startRowIndex' =&gt; 0,       \/\/ \u884c\u306e\u958b\u59cb\u4f4d\u7f6e<\/strong>\r\n<strong>            'endRowIndex' =&gt; 1,        \/\/ \u884c\u306e\u7d42\u4e86\u4f4d\u7f6e<\/strong>\r\n<strong>            'startColumnIndex' =&gt; 0,    \/\/ \u5217\u306e\u958b\u59cb\u4f4d\u7f6e<\/strong>\r\n<strong>            'endColumnIndex' =&gt; 1,      \/\/ \u5217\u306e\u7d42\u4e86\u4f4d\u7f6e<\/strong>\r\n<strong>        ],<\/strong>\r\n<strong>        'cell' =&gt; [<\/strong>\r\n<strong>            'userEnteredFormat' =&gt; [<\/strong>\r\n<strong>                'textFormat' =&gt; [<\/strong>\r\n<strong>                    'bold' =&gt; true \/\/ \u592a\u5b57\u304c\u6709\u52b9<\/strong>\r\n<strong>                ]<\/strong>\r\n<strong>            ],<\/strong>\r\n<strong>        ],<\/strong>\r\n<strong>    ],<\/strong>\r\n<strong>];<\/strong><\/pre>\n<h2>\u30d5\u30a9\u30f3\u30c8\u30b5\u30a4\u30ba\u3092\u5909\u66f4\u3059\u308b<\/h2>\n<p>\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30d5\u30a9\u30f3\u30c8\u30b5\u30a4\u30ba\u3092\u5909\u66f4\u3059\u308b\u5834\u5408\u3067\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4361\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/google_spreadsheet_18.png\" alt=\"\" width=\"248\" height=\"77\" \/><\/p>\n<pre><strong>$request_data = [<\/strong>\r\n<strong>    'repeatCell' =&gt; [<\/strong>\r\n<strong>        'fields' =&gt; 'userEnteredFormat(textFormat)',<\/strong>\r\n<strong>        'range' =&gt; [<\/strong>\r\n<strong>            'sheetId' =&gt; '\uff08\u30b7\u30fc\u30c8ID\uff09',<\/strong>\r\n<strong>            'startRowIndex' =&gt; 0,       \/\/ \u884c\u306e\u958b\u59cb\u4f4d\u7f6e<\/strong>\r\n<strong>            'endRowIndex' =&gt; 1,        \/\/ \u884c\u306e\u7d42\u4e86\u4f4d\u7f6e<\/strong>\r\n<strong>            'startColumnIndex' =&gt; 0,    \/\/ \u5217\u306e\u958b\u59cb\u4f4d\u7f6e<\/strong>\r\n<strong>            'endColumnIndex' =&gt; 1,      \/\/ \u5217\u306e\u7d42\u4e86\u4f4d\u7f6e<\/strong>\r\n<strong>        ],<\/strong>\r\n<strong>        'cell' =&gt; [<\/strong>\r\n<strong>            'userEnteredFormat' =&gt; [<\/strong>\r\n<strong>                'textFormat' =&gt; [<\/strong>\r\n<strong>                    'fontSize' =&gt; 30 \/\/ \u30d5\u30a9\u30f3\u30c8\u30b5\u30a4\u30ba<\/strong>\r\n<strong>                ]<\/strong>\r\n<strong>            ],<\/strong>\r\n<strong>        ],<\/strong>\r\n<strong>    ],<\/strong>\r\n<strong>];<\/strong><\/pre>\n<h2>\u30d5\u30a9\u30f3\u30c8\u3092\u6307\u5b9a<\/h2>\n<p>\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30d5\u30a9\u30f3\u30c8\u306e\u30bf\u30a4\u30d7\u3092\u5909\u66f4\u3059\u308b\u5834\u5408\u3067\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4362\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/google_spreadsheet_19.png\" alt=\"\" width=\"248\" height=\"58\" \/><\/p>\n<pre><strong>$request_data = [<\/strong>\r\n<strong>    'repeatCell' =&gt; [<\/strong>\r\n<strong>        'fields' =&gt; 'userEnteredFormat(textFormat)',<\/strong>\r\n<strong>        'range' =&gt; [<\/strong>\r\n<strong>            'sheetId' =&gt; '\uff08\u30b7\u30fc\u30c8ID\uff09',<\/strong>\r\n<strong>            'startRowIndex' =&gt; 0,       \/\/ \u884c\u306e\u958b\u59cb\u4f4d\u7f6e<\/strong>\r\n<strong>            'endRowIndex' =&gt; 1,        \/\/ \u884c\u306e\u7d42\u4e86\u4f4d\u7f6e<\/strong>\r\n<strong>            'startColumnIndex' =&gt; 0,    \/\/ \u5217\u306e\u958b\u59cb\u4f4d\u7f6e<\/strong>\r\n<strong>            'endColumnIndex' =&gt; 1,      \/\/ \u5217\u306e\u7d42\u4e86\u4f4d\u7f6e<\/strong>\r\n<strong>        ],<\/strong>\r\n<strong>        'cell' =&gt; [<\/strong>\r\n<strong>            'userEnteredFormat' =&gt; [<\/strong>\r\n<strong>                'textFormat' =&gt; [<\/strong>\r\n<strong>                    'fontFamily' =&gt; 'Times New Roman'   \/\/ \u30d5\u30a9\u30f3\u30c8\u540d<\/strong>\r\n<strong>                ]<\/strong>\r\n<strong>            ],<\/strong>\r\n<strong>        ],<\/strong>\r\n<strong>    ],<\/strong>\r\n<strong>];<\/strong><\/pre>\n<h2>\u30c6\u30ad\u30b9\u30c8\u3092\u659c\u3081\u306b\u3059\u308b<\/h2>\n<p>\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30c6\u30ad\u30b9\u30c8\u3092\u659c\u3081\uff08\u30a4\u30bf\u30ea\u30c3\u30af\uff09\u306b\u3059\u308b\u5834\u5408\u3067\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4363\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/google_spreadsheet_20.png\" alt=\"\" width=\"322\" height=\"58\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/google_spreadsheet_20.png 322w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/google_spreadsheet_20-300x54.png 300w\" sizes=\"auto, (max-width: 322px) 100vw, 322px\" \/><\/p>\n<pre><strong>$request_data = [<\/strong>\r\n<strong>    'repeatCell' =&gt; [<\/strong>\r\n<strong>        'fields' =&gt; 'userEnteredFormat(textFormat)',<\/strong>\r\n<strong>        'range' =&gt; [<\/strong>\r\n<strong>            'sheetId' =&gt; '\uff08\u30b7\u30fc\u30c8ID\uff09',<\/strong>\r\n<strong>            'startRowIndex' =&gt; 0,       \/\/ \u884c\u306e\u958b\u59cb\u4f4d\u7f6e<\/strong>\r\n<strong>            'endRowIndex' =&gt; 1,        \/\/ \u884c\u306e\u7d42\u4e86\u4f4d\u7f6e<\/strong>\r\n<strong>            'startColumnIndex' =&gt; 0,    \/\/ \u5217\u306e\u958b\u59cb\u4f4d\u7f6e<\/strong>\r\n<strong>            'endColumnIndex' =&gt; 1,      \/\/ \u5217\u306e\u7d42\u4e86\u4f4d\u7f6e<\/strong>\r\n<strong>        ],<\/strong>\r\n<strong>        'cell' =&gt; [<\/strong>\r\n<strong>            'userEnteredFormat' =&gt; [<\/strong>\r\n<strong>                'textFormat' =&gt; [<\/strong>\r\n<strong>                    'italic' =&gt; true   \/\/ \u659c\u3081\u6587\u5b57\u3092\u6709\u52b9<\/strong>\r\n<strong>                ]<\/strong>\r\n<strong>            ],<\/strong>\r\n<strong>        ],<\/strong>\r\n<strong>    ],<\/strong>\r\n<strong>];<\/strong><\/pre>\n<h2>\u30c6\u30ad\u30b9\u30c8\u306b\u4e0b\u7dda\u3092\u3064\u3051\u308b<\/h2>\n<p>\u30bb\u30eb\u3067\u306f\u306a\u304f\u3001\u30c6\u30ad\u30b9\u30c8\u306b\u4e0b\u7dda\u3092\u3064\u3051\u308b\u5834\u5408\u3067\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4364\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/google_spreadsheet_21.png\" alt=\"\" width=\"322\" height=\"58\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/google_spreadsheet_21.png 322w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/google_spreadsheet_21-300x54.png 300w\" sizes=\"auto, (max-width: 322px) 100vw, 322px\" \/><\/p>\n<pre><strong>$request_data = [<\/strong>\r\n<strong>    'repeatCell' =&gt; [<\/strong>\r\n<strong>        'fields' =&gt; 'userEnteredFormat(textFormat)',<\/strong>\r\n<strong>        'range' =&gt; [<\/strong>\r\n<strong>            'sheetId' =&gt; '\uff08\u30b7\u30fc\u30c8ID\uff09',<\/strong>\r\n<strong>            'startRowIndex' =&gt; 0,       \/\/ \u884c\u306e\u958b\u59cb\u4f4d\u7f6e<\/strong>\r\n<strong>            'endRowIndex' =&gt; 1,        \/\/ \u884c\u306e\u7d42\u4e86\u4f4d\u7f6e<\/strong>\r\n<strong>            'startColumnIndex' =&gt; 0,    \/\/ \u5217\u306e\u958b\u59cb\u4f4d\u7f6e<\/strong>\r\n<strong>            'endColumnIndex' =&gt; 1,      \/\/ \u5217\u306e\u7d42\u4e86\u4f4d\u7f6e<\/strong>\r\n<strong>        ],<\/strong>\r\n<strong>        'cell' =&gt; [<\/strong>\r\n<strong>            'userEnteredFormat' =&gt; [<\/strong>\r\n<strong>                'textFormat' =&gt; [<\/strong>\r\n<strong>                    'underline' =&gt; true   \/\/ \u4e0b\u7dda\u3092\u6709\u52b9<\/strong>\r\n<strong>                ]<\/strong>\r\n<strong>            ],<\/strong>\r\n<strong>        ],<\/strong>\r\n<strong>    ],<\/strong>\r\n<strong>];<\/strong><\/pre>\n<h2>\u30c6\u30ad\u30b9\u30c8\u306b\u6253\u3061\u6d88\u3057\u7dda\u3092\u3064\u3051\u308b<\/h2>\n<p>\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30c6\u30ad\u30b9\u30c8\u306b\u6253\u3061\u6d88\u3057\u7dda\u3064\u3051\u308b\u5834\u5408\u3067\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4366\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/google_spreadsheet_22.png\" alt=\"\" width=\"460\" height=\"58\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/google_spreadsheet_22.png 460w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/google_spreadsheet_22-300x38.png 300w\" sizes=\"auto, (max-width: 460px) 100vw, 460px\" \/><\/p>\n<pre><strong>$request_data = [<\/strong>\r\n<strong>    'repeatCell' =&gt; [<\/strong>\r\n<strong>        'fields' =&gt; 'userEnteredFormat(textFormat)',<\/strong>\r\n<strong>        'range' =&gt; [<\/strong>\r\n<strong>            'sheetId' =&gt; '\uff08\u30b7\u30fc\u30c8ID\uff09',<\/strong>\r\n<strong>            'startRowIndex' =&gt; 0,       \/\/ \u884c\u306e\u958b\u59cb\u4f4d\u7f6e<\/strong>\r\n<strong>            'endRowIndex' =&gt; 1,        \/\/ \u884c\u306e\u7d42\u4e86\u4f4d\u7f6e<\/strong>\r\n<strong>            'startColumnIndex' =&gt; 0,    \/\/ \u5217\u306e\u958b\u59cb\u4f4d\u7f6e<\/strong>\r\n<strong>            'endColumnIndex' =&gt; 1,      \/\/ \u5217\u306e\u7d42\u4e86\u4f4d\u7f6e<\/strong>\r\n<strong>        ],<\/strong>\r\n<strong>        'cell' =&gt; [<\/strong>\r\n<strong>            'userEnteredFormat' =&gt; [<\/strong>\r\n<strong>                'textFormat' =&gt; [<\/strong>\r\n<strong>                    'strikethrough' =&gt; true   \/\/ \u6253\u3061\u6d88\u3057\u7dda\u3092\u6709\u52b9<\/strong>\r\n<strong>                ]<\/strong>\r\n<strong>            ],<\/strong>\r\n<strong>        ],<\/strong>\r\n<strong>    ],<\/strong>\r\n<strong>];<\/strong><\/pre>\n<h2>\u67a0\u7dda\u3092\u3064\u3051\u308b<\/h2>\n<p>\u30bb\u30eb\u306b\u67a0\u7dda\u3092\u3064\u3051\u308b\u5834\u5408\u3067\u3059\u3002<\/p>\n<pre><strong>$request_data = [<\/strong>\r\n<strong>    'updateBorders' =&gt; [<\/strong>\r\n<strong>        'range' =&gt; [<\/strong>\r\n<strong>            'sheetId' =&gt; '\uff08\u30b7\u30fc\u30c8ID\uff09',<\/strong>\r\n<strong>            'startRowIndex' =&gt; 1,       \/\/ \u884c\u306e\u958b\u59cb\u4f4d\u7f6e<\/strong>\r\n<strong>            'endRowIndex' =&gt; 3,         \/\/ \u884c\u306e\u7d42\u4e86\u4f4d\u7f6e<\/strong>\r\n<strong>            'startColumnIndex' =&gt; 1,    \/\/ \u5217\u306e\u958b\u59cb\u4f4d\u7f6e<\/strong>\r\n<strong>            'endColumnIndex' =&gt; 3,      \/\/ \u5217\u306e\u7d42\u4e86\u4f4d\u7f6e<\/strong>\r\n<strong>        ],<\/strong>\r\n<strong>        'top' =&gt; [<\/strong>\r\n<strong>            'style' =&gt; 'SOLID', \/\/ \u901a\u5e38\u306e\u7dda<\/strong>\r\n<strong>            'width' =&gt; 1,<\/strong>\r\n<strong>            'color' =&gt; ['red' =&gt; 0.3]<\/strong>\r\n<strong>        ],<\/strong>\r\n<strong>        'bottom' =&gt; [<\/strong>\r\n<strong>            'style' =&gt; 'DOTTED', \/\/ \u30c9\u30c3\u30c8\u7dda<\/strong>\r\n<strong>            'width' =&gt; 1,<\/strong>\r\n<strong>            'color' =&gt; ['red' =&gt; 0.5]<\/strong>\r\n<strong>        ],<\/strong>\r\n<strong>        'right' =&gt; [<\/strong>\r\n<strong>            'style' =&gt; 'DASHED', \/\/ \u30c0\u30c3\u30b7\u30e5\u7dda<\/strong>\r\n<strong>            'width' =&gt; 1,<\/strong>\r\n<strong>            'color' =&gt; ['red' =&gt; 0.7]<\/strong>\r\n<strong>        ],<\/strong>\r\n<strong>        'left' =&gt; [<\/strong>\r\n<strong>            'style' =&gt; 'DOUBLE', \/\/ \u4e8c\u91cd\u7dda<\/strong>\r\n<strong>            'width' =&gt; 1,<\/strong>\r\n<strong>            'color' =&gt; ['red' =&gt; 1.0]<\/strong>\r\n<strong>        ]<\/strong>\r\n<strong>    ],<\/strong>\r\n<strong>];<\/strong><\/pre>\n<p>\u67a0\u7dda\u306e\u7a2e\u985e\u306f\u4ee5\u4e0b\u306e\uff16\u3064\u3067\u3059\u3002<\/p>\n<ul>\n<li>DOTTED\u3000\u30fb\u30fb\u30fb\u3000\u30c9\u30c3\u30c8\u7dda<\/li>\n<li>DASHED\u3000\u30fb\u30fb\u30fb\u3000\u30c0\u30c3\u30b7\u30e5\u7dda<\/li>\n<li>SOLID\u3000\u30fb\u30fb\u30fb\u3000\u901a\u5e38\u306e\u7dda<\/li>\n<li>SOLID_MEDIUM\u3000\u30fb\u30fb\u30fb\u3000\u901a\u5e38\u306e\u7dda\uff08\u5c11\u3057\u592a\u3081\uff09<\/li>\n<li>SOLID_THICK\u3000\u30fb\u30fb\u30fb\u3000\u901a\u5e38\u306e\u5148\uff08\u592a\u3081\uff09<\/li>\n<li>DOUBLE\u3000\u30fb\u30fb\u30fb\u3000\u4e8c\u91cd\u7dda<\/li>\n<\/ul>\n<h2>\u30bb\u30eb\u3092\u7d50\u5408\u3059\u308b<\/h2>\n<p>\u30bb\u30eb\u3092\u7d50\u5408\u3057\u305f\u3044\u5834\u5408\u3067\u3059\u3002<\/p>\n<pre><strong>$request_data = [<\/strong>\r\n<strong>    'mergeCells' =&gt; [<\/strong>\r\n<strong>        'range' =&gt; [<\/strong>\r\n<strong>            'sheetId' =&gt; '\uff08\u30b7\u30fc\u30c8ID\uff09',<\/strong>\r\n<strong>            'startRowIndex' =&gt; 0,       \/\/ \u884c\u306e\u958b\u59cb\u4f4d\u7f6e<\/strong>\r\n<strong>            'endRowIndex' =&gt; 3,        \/\/ \u884c\u306e\u7d42\u4e86\u4f4d\u7f6e<\/strong>\r\n<strong>            'startColumnIndex' =&gt; 0,    \/\/ \u5217\u306e\u958b\u59cb\u4f4d\u7f6e<\/strong>\r\n<strong>            'endColumnIndex' =&gt; 3,      \/\/ \u5217\u306e\u7d42\u4e86\u4f4d\u7f6e<\/strong>\r\n<strong>        ],<\/strong>\r\n<strong>        'mergeType' =&gt; 'MERGE_ALL' \/\/ \u7d50\u5408\u3059\u308b\u5f62\u5f0f \u203b<\/strong>\r\n<strong>    ],<\/strong>\r\n<strong>];<\/strong><\/pre>\n<p>\u7d50\u5408\u3059\u308b\u5f62\u5f0f\u306f\u4ee5\u4e0b\u306e\uff13\u3064\u3067\u3059\u3002<\/p>\n<h3>MERGE_ALL<\/h3>\n<p>\u7bc4\u56f2\u3059\u3079\u3066\u306e\u30bb\u30eb\u3092\u7d50\u5408\u3057\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4370\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/google_spreadsheet_23.png\" alt=\"\" width=\"422\" height=\"88\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/google_spreadsheet_23.png 422w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/google_spreadsheet_23-300x63.png 300w\" sizes=\"auto, (max-width: 422px) 100vw, 422px\" \/><\/p>\n<h3>MERGE_COLUMNS<\/h3>\n<p>\u30bb\u30eb\u3092\u7e26\u65b9\u5411\u306b\u7d50\u5408\u3057\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4369\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/google_spreadsheet_24.png\" alt=\"\" width=\"422\" height=\"88\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/google_spreadsheet_24.png 422w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/google_spreadsheet_24-300x63.png 300w\" sizes=\"auto, (max-width: 422px) 100vw, 422px\" \/><\/p>\n<h3>MERGE_ROWS<\/h3>\n<p>\u30bb\u30eb\u3092\u6a2a\u65b9\u5411\u306b\u7d50\u5408\u3057\u307e\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4368\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/google_spreadsheet_25.png\" alt=\"\" width=\"422\" height=\"124\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/google_spreadsheet_25.png 422w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/google_spreadsheet_25-300x88.png 300w\" sizes=\"auto, (max-width: 422px) 100vw, 422px\" \/><\/p>\n<h1>\u305d\u306e\u4ed6<\/h1>\n<h2>\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306e\u30bf\u30a4\u30c8\u30eb\u3092\u5909\u66f4\u3059\u308b<\/h2>\n<p>\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u672c\u4f53\u306e\u30bf\u30a4\u30c8\u30eb\u3092\u5909\u66f4\u3059\u308b\u5834\u5408\u3067\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4372\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/google_spreadsheet_26.png\" alt=\"\" width=\"520\" height=\"64\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/google_spreadsheet_26.png 520w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/google_spreadsheet_26-300x37.png 300w\" sizes=\"auto, (max-width: 520px) 100vw, 520px\" \/><\/p>\n<pre><strong>$request_data = [<\/strong>\r\n<strong>    'updateSpreadsheetProperties' =&gt; [<\/strong>\r\n<strong>        'properties' =&gt; [<\/strong>\r\n<strong>            'title' =&gt; '\u5909\u66f4\u3055\u308c\u305f\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u306e\u30bf\u30a4\u30c8\u30eb'<\/strong>\r\n<strong>        ],<\/strong>\r\n<strong>        'fields' =&gt; 'title'<\/strong>\r\n<strong>    ],<\/strong>\r\n<strong>];<\/strong><\/pre>\n<p>\u203b \u5b9f\u884c\u65b9\u6cd5\u306f<a href=\"#decorate_cell\">\u30bb\u30eb\u3092\u88c5\u98fe\u3059\u308b\u57fa\u672c<\/a>\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n<h2>\u30b7\u30fc\u30c8\u306e\u30bf\u30a4\u30c8\u30eb\u3092\u5909\u66f4\u3059\u308b<\/h2>\n<p>\u30b7\u30fc\u30c8\u306e\u30bf\u30a4\u30c8\u30eb\u3092\u5909\u66f4\u3059\u308b\u65b9\u6cd5\u3067\u3059\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4375\" style=\"border: 3px solid #000;\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/google_spreadsheet_27.png\" alt=\"\" width=\"365\" height=\"51\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/google_spreadsheet_27.png 365w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/08\/google_spreadsheet_27-300x42.png 300w\" sizes=\"auto, (max-width: 365px) 100vw, 365px\" \/><\/p>\n<pre><strong>$request_data = [\r\n    'updateSheetProperties' =&gt; [\r\n        'properties' =&gt; [\r\n            'sheetId' =&gt; '\uff08\u30b7\u30fc\u30c8ID\uff09',\r\n            'title' =&gt; '\u5909\u66f4\u3055\u308c\u305f\u30b7\u30fc\u30c8\u306e\u30bf\u30a4\u30c8\u30eb'\r\n        ],\r\n        'fields' =&gt; 'title'\r\n    ],\r\n];<\/strong><\/pre>\n<p>\u203b \u5b9f\u884c\u65b9\u6cd5\u306f<a href=\"#decorate_cell\">\u30bb\u30eb\u3092\u88c5\u98fe\u3059\u308b\u57fa\u672c<\/a>\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n<h1>\u304a\u308f\u308a\u306b<\/h1>\n<p>\u3068\u3044\u3046\u3053\u3068\u3067\u4eca\u56de\u306f<code>Google Spreadsheet API<\/code>\u3092\u4f7f\u3063\u3066\u30b9\u30d7\u30ec\u30c3\u30c9\u30b7\u30fc\u30c8\u3092\u64cd\u4f5c\u3059\u308b\u65b9\u6cd5\u3092\u7d39\u4ecb\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u4eca\u56deAPI\u3092\u4f7f\u3063\u3066\u307f\u3066\u611f\u3058\u305f\u3053\u3068\u306f\u3001\u307b\u307c\u30d6\u30e9\u30a6\u30b6\u3067\u3067\u304d\u308b\u3053\u3068\u304cPHP\u306e\u307f\u306a\u3089\u305a\u5404\u8a00\u8a9e\u3067\u64cd\u4f5c\u53ef\u80fd\u306a\u306e\u3067\u3001Microsoft\u306eExcel\u3068\u306f\u307e\u305f\u9055\u3063\u305f\u4f7f\u3044\u65b9\u304c\u671f\u5f85\u3067\u304d\u308b\u3093\u3058\u3083\u306a\u3044\u304b\u3068\u611f\u3058\u307e\u3057\u305f\u3002\uff08\u3057\u304b\u3082\u3001\u30d6\u30e9\u30a6\u30b6\u3067\u4f7f\u3048\u308b\u306e\u3067OS\u304cWindows\u3067\u3042\u308d\u3046\u304c\u3001Linux\u3067\u3042\u308d\u3046\u304c\u95a2\u4fc2\u306a\u3044\u3067\u3059\u3057\u3001\u306a\u3093\u3060\u3063\u305f\u3089\u30b9\u30de\u30db\u7528\u306e\u30a2\u30d7\u30ea\u3082\u3042\u308a\u307e\u3059\u3057\u306d\ud83d\ude0a\u2728\uff09<\/p>\n<p>\u305f\u3060\u3001Google \u306f\u3053\u3046\u3044\u3063\u305f\u4fdd\u5b58\u30c7\u30fc\u30bf\u3092\u5229\u7528\u3057\u3066\u500b\u4eba\u7684\u306a\u8da3\u5473\u55dc\u597d\u3092\u5224\u5225\u3057\u5e83\u544a\u8868\u793a\u3057\u3066\u3044\u308b\u3068\u8a00\u308f\u308c\u3066\u3044\u308b\u306e\u3067\u3001\u305d\u3053\u3092\u3069\u3046\u611f\u3058\u308b\u304b\u3068\u3044\u3046\u8a71\u306f\u3042\u308b\u304b\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u305c\u3072\u7686\u3055\u3093\u3082\u3053\u306e\u8a18\u4e8b\u3092\u4f7f\u3063\u3066\u3044\u308d\u3044\u308d\u3068\u8a66\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u306d\u3002<\/p>\n<p>\u3067\u306f\u3067\u306f\u301c\uff01<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-3467 aligncenter\" src=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_9.png\" alt=\"\" width=\"216\" height=\"320\" srcset=\"https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_9.png 216w, https:\/\/blog.capilano-fw.com\/wp-content\/uploads\/2019\/04\/no_9-203x300.png 203w\" sizes=\"auto, (max-width: 216px) 100vw, 216px\" \/><\/p>\n<p><strong>\u3010\u8ffd\u8a18\uff1a2020.5.25\u3011<\/strong><\/p>\n<p>\u533f\u540d\u30e6\u30fc\u30b6\u30fc\u69d8\u304b\u3089\u300cv4\u3067\u306f\u306a\u304fv3\u3067\u306f\u306a\u3044\u3067\u3057\u3087\u3046\u304b\u300d\u3068\u3054\u6307\u6458\u3092\u3044\u305f\u3060\u304d\u307e\u3057\u305f\u3002<\/p>\n<p>\u7686\u69d8\u3001\u3044\u3064\u3082\u3042\u308a\u304c\u3068\u3046\u3054\u3056\u3044\u307e\u3059\ud83d\ude0a\u2728<\/p>\n<p>\u65e9\u901f\u5f53\u6642\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3057\u305f\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u78ba\u8a8d\u3057\u3066\u307f\u305f\u306e\u3067\u3059\u304c\u3001\u7d50\u679c\u3068\u3057\u3066\u300cService definition for Sheets (v4)\u300d\u3068\u66f8\u3044\u3066\u3042\u3063\u305f\u305f\u3081\u3001\u73fe\u6642\u70b9\u3067\u306f v4 \u3067\u306f\u306a\u3044\u304b\u3068\u8003\u3048\u3066\u304a\u308a\u307e\u3059\u3002<\/p>\n<p>\u305f\u3060\u3001\u307e\u3060\u3042\u3084\u3075\u3084\u306a\u70b9\u3082\u3042\u308a\u307e\u3059\u306e\u3067\u3001\u3082\u3057\u3069\u306a\u305f\u304b\u3053\u306e\u4ef6\u306b\u95a2\u3057\u3066\u60c5\u5831\u304c\u3042\u308a\u307e\u3057\u305f\u3089\u305c\u3072\u6559\u3048\u3066\u3044\u305f\u3060\u3051\u307e\u3059\u3068\u5b09\u3057\u3044\u3067\u3059\u3002<\/p>\n<p>\u3069\u3046\u305e\u3088\u308d\u3057\u304f\u304a\u9858\u3044\u3044\u305f\u3057\u307e\u3059\u3002m_ _m\uff08\u6642\u9593\u304c\u7a7a\u3044\u3066\u3057\u307e\u3046\u3068\u3001\u5f53\u6642\u306e\u3053\u3068\u304c\u30c8\u30b3\u30ed\u30c6\u30f3\u65b9\u5f0f\u3067\u629c\u3051\u843d\u3061\u3066\u3066\u3057\u307e\u3046\u3093\u3067\u3059\u3088\u306d\u30fb\u30fb\u30fb\ud83d\ude02\uff09<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3055\u3066\u3055\u3066\u3001\u3053\u306e\u9593 PhpSpreadsheet\u3067Excel\u3092\u64cd\u4f5c\u3059\u308b\u516826\u5b9f\u4f8b\uff01\u3068\u3044\u3046\u8a18\u4e8b\u3092\u516c\u958b\u3057\u307e\u3057\u305f\u304c\u3001\u610f\u5916\u306b\u3082\u3053\u306e\u8a18\u4e8b\u3078\u306e\u30a2\u30af\u30bb\u30b9\u304c\u591a\u304b\u3063\u305f\u306e\u3067\u300c\u3084\u3063\u3071\u308a &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blog.capilano-fw.com\/?p=4337\" class=\"more-link\"><span class=\"screen-reader-text\">&#8220;\u3010PHP\u3011Google spreadsheet API\uff08V4\uff09\u306e\u4f7f\u3044\u65b9\u30fb\u516825\u5b9f\u4f8b\uff01&#8221; \u306e<\/span>\u7d9a\u304d\u3092\u8aad\u3080<\/a><\/p>\n","protected":false},"author":1,"featured_media":4379,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[29,99],"class_list":["post-4337","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-php","tag-google","tag-99"],"_links":{"self":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/4337","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4337"}],"version-history":[{"count":21,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/4337\/revisions"}],"predecessor-version":[{"id":7406,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/posts\/4337\/revisions\/7406"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=\/wp\/v2\/media\/4379"}],"wp:attachment":[{"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4337"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4337"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.capilano-fw.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4337"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}