Hey, it's youre newest noob here again!
I made a combobox for a macro that I am making, but I have a quick question. I found some code that helped me with this one, but I'm not sure how to pass the selected value in the combo box to the quickpad, then to a field in the session once the "OK" button is clicked. I have:
'=============================================================
'======THIS IS THE COMBOBOX=========
Dim Make(6) as String 'quantity of slots in the list starts at 0
Make(0) = "BKirsch"
Make(1) = "JSmith"
Make(2) = "rjones"
Begin Dialog dlgOptions 10, 28, 100, 100, "Select"
OkButton 60, 20, 20, 10,.btnOK
DropComboBox 10, 20, 40, 20, Make(), .MakeComboBox
End Dialog
iDone = FALSE
While (iDone = FALSE) 'not sure what this section is doing.
Dim dlgVar as dlgOptions
nRet = Dialog(dlgVar)
Select Case nRet
Case -1
iDone = TRUE
End Select
Wend'===================================================================
'check for the next blank line
Do
With objWorkBook.Worksheets("Sheet1").Cells(r, 1)
If Trim(.Value) = "" Then
.Value = gs
Exit Do
Else
'continue testing for the next row
r = r + 1
End If
End With
Loop
Sess0.Screen.WaitHostQuiet (g_HostSettleTime)
'copy eash line to excel
gs = Sess0.Screen.GetString (03, 13, 06) 'Gets sup name
objWorkBook.WorkSheets("Sheet1").Cells(r,1).Value = gs 'Transfers case number to Excel
gs = Sess0.Screen.GetString (14, 19, 11) 'auditor
objWorkBook.WorkSheets("Sheet1").Cells(r,2).Value = gs 'Transfers auditor to Excel
gs = Sess0.Screen.GetString (14, 48, 10) 'Gets aud name
objWorkBook.WorkSheets("Sheet1").Cells(r,3).Value = gs 'Transfers supervisor to Excel
' Excel will remain open after this Sub ends.
' To close out Excel, unremark the following 4 lines of code. .
objExcel.ActiveWorkBook.Save
'objWorkBook.Close
'objExcel.Quit
'set objWorkBook = Nothing
'set objExcel = Nothing
End sub
I made a combobox for a macro that I am making, but I have a quick question. I found some code that helped me with this one, but I'm not sure how to pass the selected value in the combo box to the quickpad, then to a field in the session once the "OK" button is clicked. I have:
'=============================================================
'======THIS IS THE COMBOBOX=========
Dim Make(6) as String 'quantity of slots in the list starts at 0
Make(0) = "BKirsch"
Make(1) = "JSmith"
Make(2) = "rjones"
Begin Dialog dlgOptions 10, 28, 100, 100, "Select"
OkButton 60, 20, 20, 10,.btnOK
DropComboBox 10, 20, 40, 20, Make(), .MakeComboBox
End Dialog
iDone = FALSE
While (iDone = FALSE) 'not sure what this section is doing.
Dim dlgVar as dlgOptions
nRet = Dialog(dlgVar)
Select Case nRet
Case -1
iDone = TRUE
End Select
Wend'===================================================================
'check for the next blank line
Do
With objWorkBook.Worksheets("Sheet1").Cells(r, 1)
If Trim(.Value) = "" Then
.Value = gs
Exit Do
Else
'continue testing for the next row
r = r + 1
End If
End With
Loop
Sess0.Screen.WaitHostQuiet (g_HostSettleTime)
'copy eash line to excel
gs = Sess0.Screen.GetString (03, 13, 06) 'Gets sup name
objWorkBook.WorkSheets("Sheet1").Cells(r,1).Value = gs 'Transfers case number to Excel
gs = Sess0.Screen.GetString (14, 19, 11) 'auditor
objWorkBook.WorkSheets("Sheet1").Cells(r,2).Value = gs 'Transfers auditor to Excel
gs = Sess0.Screen.GetString (14, 48, 10) 'Gets aud name
objWorkBook.WorkSheets("Sheet1").Cells(r,3).Value = gs 'Transfers supervisor to Excel
' Excel will remain open after this Sub ends.
' To close out Excel, unremark the following 4 lines of code. .
objExcel.ActiveWorkBook.Save
'objWorkBook.Close
'objExcel.Quit
'set objWorkBook = Nothing
'set objExcel = Nothing
End sub