You have to define the range by B3:C5
for two columns or A1:A17
for one column and so on. The range has to be divided by colon ":" sign.
#include-once
#include <Array.au3>
#include <Excel.au3>
Global $sFileExcel = @DesktopDir & '\MyExcelSheet.xlsx'
Global $sExcelRange = 'B3:C5'
Func _readExcelContent()
Local $oExcel = _Excel_Open()
Local $oWorkbook = _Excel_BookOpen($oExcel, $sFileExcel)
Local $aData = _Excel_RangeRead($oWorkbook, Default, $sExcelRange, 2)
_Excel_Close($oExcel, Default, True) ; excel will be closed
Return $aData
EndFunc
Global $aData = _readExcelContent()
_ArrayDisplay($aData) ; this is just a preview of the read data
ClipPut(_ArrayToString($aData))
The result/output could be :
text1|
text2|text4
text3|
Depending on Excel content of course.