Ewa.SheetCollection オブジェクト

**適用対象:**apps for SharePoint | Excel Services | SharePoint Server 2013

ブック内のシートのコレクションを表します。

Ewa.SheetCollection

注釈

Ewa.SheetCollectionでは、グラフ シートを含む、ブック内のすべてのシート オブジェクトを表します。ここでは、マクロ シートは含まれません。インデックスは、0 から始まるギャップがないです。このコレクションは、アクセシビリティの高いnamed item viewモードではありません。

注意

コレクションには、非表示のシートが含まれていますが、公開されたアイテムのみを表示する、アクセス権を制限する場合これら返されません。

次の例では、ページにボタンを追加する方法について説明し、ブック内のシートの数を取得し、ブラウザーのステータス バーの数を表示する] ボタンのonClickイベントにコードを追加します。コードの例をExcel Web Access Web パーツでSharePoint Server 2013で作業していることを前提としています。

<script type="text/javascript">
 
var ewa = null;
 
// Add event handler for onload event.
if (window.attachEvent) 
{ 
    window.attachEvent("onload", ewaOnPageLoad);    
} 
else 
{ 
    window.addEventListener("DOMContentLoaded", ewaOnPageLoad, false); 
}

// Add event handler for applicationReady event.
function ewaOnPageLoad() 
{ 
Ewa.EwaControl.add_applicationReady(onApplicationReady); 
} 

function onApplicationReady()
{        
    // Get a reference to the Excel Services Web Part.
    ewa = Ewa.EwaControl.getInstances().getItem(0);                                       
}              

function getSheetCountButton()
{
    // Get a reference to the active workbook.
    var workbook = ewa.getActiveWorkbook();   
    
    // Display the number of sheets in the active workbook.
    window.status = "The workbook has " + workbook.getSheets().getCount() + " worksheets.";
}

</script>
<input type="button" id="GetSheetCount" VALUE="Get Sheet Count" onclick="getSheetCountButton()">

関連項目

概念

Ewa.SheetCollection 方法