// Create an instance of the class that exports Excel files, having two sheets
ExcelDocument workbook = new ExcelDocument(2);
// Set sheet names
workbook.easy_getSheetAt(0).setSheetName("First tab");
workbook.easy_getSheetAt(1).setSheetName("Second tab");
...
// Create named range
xlsSecondTab.easy_addName("Range", "=Second tab!$A$1:$A$4");
// Export Excel file
workbook.easy_WriteXLSXFile("C:\\Samples\\Excel named range.xlsx");
' Create an instance of the class that exports Excel files, having two sheetsDim workbook As New ExcelDocument(2)
' Set sheet names
workbook.easy_getSheetAt(0).setSheetName("First tab")
workbook.easy_getSheetAt(1).setSheetName("Second tab")
...
' Create named range
xlsSecondTab.easy_addName("Range", "=Second tab!$A$1:$A$4")
' Export Excel file
workbook.easy_WriteXLSXFile("C:\Samples\Excel named range.xlsx")
C++// Create an instance of the class that exports Excel files
EasyXLS::IExcelDocumentPtr workbook;
hr = CoCreateInstance(__uuidof(EasyXLS::ExcelDocument),
NULL,
CLSCTX_ALL,
__uuidof(EasyXLS::IExcelDocument),
(void**) &workbook) ;
// Create two sheets
workbook->easy_addWorksheet_2("First tab");
workbook->easy_addWorksheet_2("Second tab");
...
// Create named range
xlsSecondTab->easy_addName_2("Range", "=Second tab!$A$1:$A$4");
// Export Excel file
workbook->easy_WriteXLSXFile("C:\\Samples\\Excel named range.xlsx");
Click here to see Continuous Code ListingC++.NET// Create an instance of the class that exports Excel files, having two sheets
ExcelDocument ^workbook = gcnew ExcelDocument(2);
// Set sheet names
workbook->easy_getSheetAt(0)->setSheetName("First tab");
workbook->easy_getSheetAt(1)->setSheetName("Second tab");
...
// Create named range
xlsSecondTab->easy_addName("Range", "=Second tab!$A$1:$A$4");
// Export Excel file
workbook->easy_WriteXLSXFile("C:\\Samples\\Excel named range.xlsx");
Click here to see Continuous Code Listing
// Create an instance of the class that exports Excel files, having two sheets
ExcelDocument workbook = new ExcelDocument(2);
// Set sheet names
workbook.easy_getSheetAt(0).setSheetName("First tab");
workbook.easy_getSheetAt(1).setSheetName("Second tab");
...
// Create named range
xlsSecondTab.easy_addName("Range", "=Second tab!$A$1:$A$4");
// Export Excel file
workbook.easy_WriteXLSXFile("C:\\Samples\\Excel named range.xlsx");
.NET:// Create an instance of the class that exports Excel files
$workbook = new COM("EasyXLS.ExcelDocument");
// Create two sheets
$workbook->easy_addWorksheet_2("First tab");
$workbook->easy_addWorksheet_2("Second tab");
...
// Create named range
$xlsSecondTab->easy_addName_2("Range", "=Second tab!\$A\$1:\$A\$4");
// Export Excel file
$workbook->easy_WriteXLSXFile("C:\Samples\Excel named range.xlsx");
Click here to see Continuous Code ListingJava:// Create an instance of the class that exports Excel files
$workbook = new java("EasyXLS.ExcelDocument");
// Create two sheets
$workbook->easy_addWorksheet("First tab");
$workbook->easy_addWorksheet("Second tab");
...
// Create a named area range
$xlsSecondTab->easy_addName("Range", "='Second tab'!\$A\$1:\$A\$4");
// Export Excel file
$workbook->easy_WriteXLSXFile("C:\Samples\Excel named range.xlsx");
Click here to see Continuous Code Listing
' Create an instance of the class that exports Excel filesset workbook = Server.CreateObject("EasyXLS.ExcelDocument")
' Create two sheets
workbook.easy_addWorksheet_2("First tab")
workbook.easy_addWorksheet_2("Second tab")
...
' Create named range
xlsSecondTab.easy_addName_2 "Range", "=Second tab!$A$1:$A$4"' Export Excel file
workbook.easy_WriteXLSXFile("C:\Samples\Excel named range.xlsx")
' Create an instance of the class that exports Excel filesSet workbook = CreateObject("EasyXLS.ExcelDocument")
' Create two sheets
workbook.easy_addWorksheet_2("First tab")
workbook.easy_addWorksheet_2("Second tab")
...
' Create named range
xlsSecondTab.easy_addName_2 "Range", "=Second tab!$A$1:$A$4"' Export Excel file
workbook.easy_WriteXLSXFile("C:\Samples\Excel named range.xlsx")
' Create an instance of the class that exports Excel filesSet workbook = CreateObject("EasyXLS.ExcelDocument")
' Create two sheets
workbook.easy_addWorksheet_2("First tab")
workbook.easy_addWorksheet_2("Second tab")
...
' Create named range
xlsSecondTab.easy_addName_2 "Range", "=Second tab!$A$1:$A$4"' Export Excel file
workbook.easy_WriteXLSXFile("C:\Samples\Excel named range.xlsx")
<!-- Create an instance of the class that exports Excel files --><cfobject type="java"class="EasyXLS.ExcelDocument"name="workbook"action="CREATE"><!-- Create two sheets --><cfset ret = workbook.easy_addWorksheet("First tab")><cfset ret = workbook.easy_addWorksheet("Second tab")>
...
<!-- Create named range --><cfset xlsSecondTab.easy_addName("Range", "=Second tab!$A$1:$A$4")><!-- Export Excel file --><cfset ret = workbook.easy_WriteXLSXFile("C:\Samples\Excel named range.xlsx")>
.NET:# Create an instance of the class that exports Excel files, having two sheets
workbook = ExcelDocument(2)
# Set the sheet names
workbook.easy_getSheetAt(0).setSheetName("First tab")
workbook.easy_getSheetAt(1).setSheetName("Second tab")
...
# Create a named area range
xlsSecondTab.easy_addName("Range", "='Second tab'!$A$1:$A$4")
# Export Excel file
workbook.easy_WriteXLSXFile("C:\\Samples\\Excel named range.xlsx")
Click here to see Continuous Code ListingJava:# Create an instance of the class that exports Excel files, having two sheets
workbook = gateway.jvm.ExcelDocument(2)
# Set the sheet names
workbook.easy_getSheetAt(0).setSheetName("First tab")
workbook.easy_getSheetAt(1).setSheetName("Second tab")
...
# Create a named area range
xlsSecondTab.easy_addName("Range", "='Second tab'!$A$1:$A$4")
# Export Excel file
workbook.easy_WriteXLSXFile("C:\\Samples\\Excel named range.xlsx")
Click here to see Continuous Code Listing
The screen shot provides an example of an Excel file with two sheets. The second sheet has a defined name for a range of cells.