This is my first question so please go easy on me.
My company is working with Reflection for UNIX and OpenVMS and I'm building a database that interacts with the software as it is impossible for me to access the database behind the Reflection application (too many authorizations required etc...).
I'm working with MS Access 2013 right now and coding in VBA. My main issue is closing the Reflection instance in a clean manner.
The following code works fine for me :
Sub Test()
Dim strUserId As String
Dim MyObject As Reflection2.Session
Set MyObject = GetObject(Path)
strUserId = InputBox("Enter user ID.")
ContractNum = InputBox("Enter a contract number :")
With MyObject
.Visible = True
.Connect
.Transmit strUserId
.TransmitTerminalKey rcVtEnterKey
.Transmit ContractNum
.TransmitTerminalKey rcVtEnterKey
sContractNum = .GetText(1, 18, 1, 28)
'Do other shit
End With
**Exit Reflection**
Set MyObject = Nothing
End Sub
I have tried the following methods :
MyObject.Close ==> Returns : "Run-time error '438': Object doesn't support this property of method"
MyObject.Exit ==> Returns : "Run-time error '438': Object doesn't support this property of method"
MyObject.Quit ==> Returns : "Run-time error '10097': This function not available when running Reflection as a document object."
There is: MyObject.ConfirmExit = True
but as it says, it only confirms and doesn't close.
Anyway I was hoping someone would help before doing a hard closing through Shell command (wouldn't be difficult to find on Google I guess).
Thank you!!
Aucun commentaire:
Enregistrer un commentaire