[英]Google Sheet API - How to copy/paste an entire sheet to another spreadsheet?
我有一個生產電子表格和一個開發電子表格。
我需要將第一張生產文件復制到開發文件中。
我無法理解copyTo的用法,因為無法設置目的地。
如何將一張紙從一張紙復制到另一張紙?
我正在使用 PHP !
由於您使用的是 PHP,請參閱Google 表格 PHP 快速入門以了解如何在 API 中設置和使用 APIF92FEC392304A5C23AC138DA22847F9B7CZ
使用spreadsheets.sheets.copyTo將工作表復制到不同電子表格的示例代碼:
$service = new Google_Service_Sheets($client);
$requestBody = new Google_Service_Sheets_CopySheetToAnotherSpreadsheetRequest();
$requestBody->setDestinationSpreadsheetId($destinationSpreadsheetId);
$response = $service->spreadsheets_sheets->copyTo($originalSpreadsheet, $sheetId, $requestBody);
setDestinationSpreadsheetId($destinationSpreadsheetId)
方法設置destinationId
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.