I've got an open xlsx book. How to use the XLGet function.
The file was generated by an app so it is not yet saved.
I want to save it as an xls file to use it has an array.
Thank you!



Moderators: JRL, Dorian (MJT support)
Code: Select all
Let>fichier=C:\Users\%USER_NAME%\AppData\Local\Temp\GWPR.XLSX
XLGet>%fichier%,xlBook
XLSave>%xlBook%,%USERDOCUMENTS_DIR%\mybook.xls,16
Code: Select all
XLSheetToArray>%USERDOCUMENTS_DIR%\mybook.xls,Sheet1,xlData
Let>nombre=%xlData_count%
Let>duree=xlData_%nombre=%_1
Let>age=xlData_%nombre=%_2
Code: Select all
XLSave>xlBook,d:\mybook.xls,39
XLSave>xlBook,d:\mybook.xls
Code: Select all
XLSheetToArray>d:\mybook.xls,Sheet1,array
Code: Select all
0: ARRAY_1_1=qq
0: ARRAY_1_2=ww
0: ARRAY_1_COUNT=3
0: ARRAY_2_1=ee
0: ARRAY_2_2=rr
0: ARRAY_2_3=
0: ARRAY_2_COUNT=3
0: ARRAY_3_1=tt
0: ARRAY_3_2=yy
0: ARRAY_3_COUNT=3
0: ARRAY_4_1=
0: ARRAY_4_3=
0: ARRAY_COUNT=4
Code: Select all
XLOpen>C:\Users\%USER_NAME%\AppData\Local\Temp\GWPR.XLSX,1,xlBook
Let>WIN_USEHANDLE=1
GetActiveWindow>xlBook,X,Y[,Width,Height]
Let>WIN_USEHANDLE=1
UIClick>{%xlBook%},{"File Tab"}
Wait>1
UIFocus>{%xlBook%},{"Save As"}
Wait>1
UIFocus>{%xlBook%},{"Save as type"}
Wait>1
Press Down
Wait>1
Press Down*3
Wait>.5
Press Enter
Press TAB
Wait>.5
Press Enter
Wait>1
Press Enter
Wait>1
Press LALT
Press F4
Code: Select all
UIGetValue>{%window_CanVie_3%},{"Prime annualisée requise
($) Ligne 9"},curVals,Positions,nHeight
Code: Select all
XLSheetToArray>%USERDOCUMENTS_DIR%\mybook.xls,Sheet1,xlData
//la matrice a un header et donc le compte affiche le nombre de lignes plus 1
Let>compte=%xlData_count%
Let>nombre=%xlData_count% - 1
//MDL>nb de lignes du xls -> %nombre%
//Avec Canada Vie le tableau va jusqu'à 105
//Le tableau montre l'âge initial de l'assuré + 1
//Âge réel AgeR est donc %age% + 1
Let>age=105 - %nombre%
Let>ageR=%age% + 1
//MDL>Àge de l'assuré -> %ageR%
//Boucle la matrice
Let>v=1
repeat>v
Let>v=v+1
//Récupère la valeur de la col 1 à chaque multiple de 10 durées
Let>x={%v% mod 10}
Let>valeur=xlData_%v%_1
IF>x=0
MDL>%valeur%
Endif
Until>v=%compte%