Share via


Ewa.Range.getAddressA1()

Applies to: apps for SharePoint | Excel Services | SharePoint Server 2013

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

Type: 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. The code example assumes that you are working with Excel Web Access Web Parts on 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); 
    
    // 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