Share via


Ewa.Range.getAddressA1()

Applies to: apps for SharePoint | SharePoint Server 2010

In this article
Return Value
Remarks
Example
Applies To

Gets the range coordinates of the specified range in A1 format, including the worksheet name.

var value = Ewa.Range.getAddressA1();

Return Value

string

Remarks

The Ewa.Range.getAddressA1 method returns the range coordinates of the specified range in A1 format, including the worksheet name. The range coordinates include the sheet name in sheet view. The A1 address includes the sheet name in sheet view, workbook view, and named item view.

Example

The following code example shows how to get a range ("B2:C5") from worksheet "mySheet", selects a cell ("B4") within the range, and then displays the range coordinates of the range in A1 format in the browser status bar.

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

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

function getEwa()
{        
    // Get a reference to the Excel Services Web Part.
    ewa = Ewa.EwaControl.getInstances().getItem(0); 
    
    // Get range "B2:C5" from sheet, "mySheet".
    var range = ewa.getActiveWorkbook().getRange('mySheet',1,1,4,2);
    
    // Display range coordinates in browser status bar.
    window.status = "Range coordinates in A1 format: " + range.getAddressA1();                                  
}        
</script>
 

Applies To

Ewa.Range Object

See Also

Concepts

Ewa.Range Methods

Ewa Namespace