gameonly308
Thành viên hoạt động



			
		- Tham gia
 - 4/5/09
 
- Bài viết
 - 197
 
- Được thích
 - 10
 
Chào các bác, em có 1 đoạn script download cả 1 Goole Sheet về máy, giờ em muốn down 1 sheet riêng lẻ thôi, vd như Sheet "ABC" thì phải sửa script thế nào ạ?
	
	
	
		
link đây ạ: link đây ạ
				
			
		Mã:
		
	
	/**
* Adds a custom menu
*
* @param {Object} e The event parameter for a simple onOpen trigger.
*/
function onOpen(e) {
  SpreadsheetApp.getUi()
      .createMenu('Custom')
      .addItem('Download as XLSX', 'downloadXLS_GUI')
      .addToUi();
}
/**
* Display a modal dialog with a single download link.
*
* From: http://stackoverflow.com/a/37336778/1677912
*/
function downloadXLS_GUI() {
  // Get current spreadsheet's ID, place in download URL
  var ssID = SpreadsheetApp.getActive().getId().getSheetByName("ABC");
  var URL = 'https://docs.google.com/spreadsheets/d/'+ssID+'/export?format=xlsx';
  // Display a modal dialog box with download link.
  var htmlOutput = HtmlService
                  .createHtmlOutput('<a href="'+URL+'">Click to download</a>')
                  .setSandboxMode(HtmlService.SandboxMode.IFRAME)
                  .setWidth(120)
                  .setHeight(100);
  SpreadsheetApp.getUi().showModalDialog(htmlOutput, 'Download XLS');
}
	
			
				Lần chỉnh sửa cuối: 
			
		
	
								
								
									
	
								
							
							
	
	  