This is the code I use for displaying excel data in a gui. (a name and a number)
Code: Select all
xl := ComObjCreate("excel.application")
wrkbk := xl.workbooks.open("C:\Users\user\Desktop\HI.xlsm")
Gui, Add, Progress, x0 y0 w0 h0
Gui, Add, Monthcal, x250 y10
Gui, font, s10, Verdana
Gui, Color, Yellow
for sh in xl.sheets
if (a_index > 2)
{
lstrw := sh.Range("B" xl.Rows.Count).End(-4162).Row
lstrw1 := sh.Range("A" xl.Rows.Count).End(-4162).Row
runs :=sh.Range("B" lstrw).text
name :=sh.Range("A" lstrw).text
if a_Index = 3 ; the first possible value after meeting the condition "if (a_index > 2)"
Gui, Add, Text, x1 y1 wp , %name% %runs% ; first iteration start at y10
else
Gui, Add, Text, x1 y+10 wp , %name% %runs% ; subsequent iterations at y+10 relative to previously added control
}
Gui Show
sh := ""
xl.quit()
xl := ""
I just want the name to be displayed in one area and the number in another ( Similar to cells in excel. One entry will be shown in each cell. Like that I want the Name to be shown in one area of the GUI and Number to be shown in another area in the same line as the name )
I am using the following code for testing
Code: Select all
Gui, Add, Progress, x0 y0 w0 h0
Gui, Add, Monthcal, x250 y10
Gui, font, s10, Verdana
Gui, Color, Yellow
Gui, Add, Text, x1 y1 wp , John 1
Gui Show
Can someone please guide / help me ?
Regards