We have some macros triggering from Microsoft Office products via VBA that connect to BlueZone to run small-scale automation. In recent months, we've noticed some issues with users being unable to trigger these macros on their 7.x installations, but others that have 5.x (e.g. BlueZone Mainframe Display v5.2 Build 1418) are still able to run correctly. Are there changes needed to VBA macros to function appropriately with 7.x installations?
Function examples that are working in 5, but not 7:
'Define global Bluezone Variables
Global SystemBZ As Object
Global Sess0
Global Screen
Global Const TestEnvironment As Boolean = False
Global Const DEFAULT_SCREEN As String = "LACO0010"
'###############################################
'# Name: BZ_Connect()
'# PURPOSE: Create a new Bluezone Connection
'###############################################
Sub BZ_Connect()
Set SystemBZ = CreateObject("BZWhll.Whllobj")
Set Sess0 = SystemBZ.ActiveSession
Set Screen = Sess0.Screen
End Sub
'###################################################
'# Name: BZ_Terminate()
'# PURPOSE: Terminate Existing Bluezone Connection
'###################################################
Sub BZ_Terminate()
If Not (SystemBZ Is Nothing) Then
SystemBZ.Disconnect
Set SystemBZ = Nothing
Set Sess0 = Nothing
Set Screen = Nothing
End If
End Sub
'###############################################
'# Name: BZ_Initiate()
'# PURPOSE: Initiate a new Bluezone Connection
'###############################################
Function BZ_Initiate()
'Terminate the existing session
Call BZ_Terminate
'Create a new connection to BlueZone
Call BZ_Connect
End Function
'###############################################
'# Name: ReadScreen()
'# PURPOSE: Bluezone Screen Scrape
'# Returns: String
'###############################################
Function ReadScreen(L As Integer, x As Integer, y As Integer, Optional blnTrim As Boolean = False)
SystemBZ.ReadScreen ReadScreen, L, x, y
If blnTrim Then
ReadScreen = Trim(ReadScreen)
End If
End Function
'###############################################
'# Name: WriteScreen()
'# PURPOSE: Write data to Bluezone
'###############################################
Sub WriteScreen(str, x As Integer, y As Integer)
SystemBZ.WriteScreen str, x, y
End Sub
'###############################################
'# Name: Send()
'# PURPOSE: Send keys to Bluezone
'###############################################
Sub Send(str As String, lWait As Long)
Screen.SendKeys str
Select Case str
Case "<ENTER>", "<PF1>", "<PF2>", "<PF3>", "<PF4>", "<PF5>", "<PF6>", "<PF7>", "<PF8>", "<PF9>", "<PF10>", "<PF11>", _
"<PF12>", "<PF13>", "<PF14>", "<PF15>", "<PF16>", "<PF17>", "<PF18>", "<PF19>", "<PF20>", "<PF21>", "<PF22>", _
"<PF23>", "<PF24>", "<PA1>"
SystemBZ.WaitReady 10, lWait
End Select
End Sub
'###############################################
'# Name: SetCursor()
'# PURPOSE: Send keys to Bluezone
'###############################################
Sub SetCursor(x As Integer, y As Integer)
SystemBZ.SetCursor x, y
End Sub