hi,
i generated the following code in my previos post which works fine in extra. now, i'm trying the same thing using excel vba but unfortunately the coding is not the same. i get a "compile error: expected:lib"
is this something simple to fix and implement?
i'm not familiar with doing this using vba.
thanks
zach
i generated the following code in my previos post which works fine in extra. now, i'm trying the same thing using excel vba but unfortunately the coding is not the same. i get a "compile error: expected:lib"
is this something simple to fix and implement?
i'm not familiar with doing this using vba.
thanks
zach
Code:
Declare Function DisplayChoice(szLocale$) As String
Sub Main
Dim szLocation$
Dim iDone%
Dim DroplistBox as string
Dim Sys As Object, Sess As Object
Set Sys = CreateObject("Extra.System")
Dim SessionNames() As String
SessionCount = Sys.Sessions.Count
For SessionCnt = 0 To Sys.Sessions.Count
ReDim Preserve SessionNames(SessionCnt)
SessionNames(Sessioncnt) = Sys.Sessions.Item(SessionCnt).Name
Next
Begin Dialog dlgHouseSample 0, 1, 175, 93, "Please Select a Session to Run Macro"
ButtonGroup .ButtonPressed
OkButton 100, 15, 50, 14
CancelButton 100, 35, 50, 14
PushButton 100, 55, 50, 14, "&Reset", .btnReset
Text 12, 5, 62, 9, "Available Sessions"
DropComboBox 10, 15,65,55, SessionNames(), .dcbLocation
End Dialog
iDone = FALSE
While (iDone = FALSE)
Dim dMain as dlgHouseSample
nRet = Dialog(dMain)
Select Case nRet
Case -1 ' -1 is returned if the user chose OK
iDone = TRUE
szLocation = dMain.dcbLocation
If SzLocation = "" Then
MsgBox "You Didn't Select a Session. Please start over"
Exit Sub
End If
Set Sess = Sys.ActiveSession
For i=1 to Sys.Sessions.Count
If SzLocation = Sys.Sessions.Item(i) Then
Set Sess=Sys.Sessions.Item(i)
MsgBox "Activating session " + Sess.Name + "."
Sess.Activate
Exit For
End If
Next
Case 0 ' 0 is returned if the user chose Cancel
iDone = TRUE
msgbox "Please select a Session"
Case 1 ' 1 is returned if the user chose Reset
dMain.dcbLocation = ""
Case Else
msgbox "Some undefined button pressed " + str(dMain.ButtonPressed)
End Select
Wend
End Sub
'--------------------------------------------------------------------------------
Function DisplayChoice(szLocale$) As String
szResult = szLocale
DisplayChoice = szResult
End Function