vba interaction with appv applications
- We have successfully sequenced Passport 2007 and deployed it. We have an outside contractor that has created some office documents that want to interact with this application through vba macros in the documents. the macros can see the applications just as it would if installed locally, but certain functions don't work properly. Has anyone else tried this??
Thanks in advance for your help.
All Replies
- Hello,
I usually think that any application installed natively can not see the application, however the sequenced application can see anything installed natively.
Now, I don't know your exact setup - so please eloborate on what it sees and what it doesn't....
/Znack It can see the process as listed in the task manager. maybe my code would help explain a little better what i'm trying to do.
Dim Extra As Object
Dim Scr As Object
Dim sht As Worksheet
Sub main()
SetupSession
End Sub
Sub SetupSession()
Set Extra = CreateObject("Passport.System")
Set Scr = Extra.sessions.Item(ChosenSession).Screen
Set sht = ActiveSheet
sht.Cells(1, "A") = Scr.getstring(11, 7, 5)
Set Scr = Nothing
Set Extra = Nothing
MsgBox "macro done."
End SubFunction ChosenSession() As Integer
Dim ReturnVal As String
Dim SessionCount As Integer
Dim NotFinished As Boolean
SessionCount = Extra.sessions.CountIf SessionCount < 1 Then
MsgBox "Please open a mainframe session.", vbOKOnly + vbCritical, "OOPS!"
End
Else
'Iterate through all open sessions...
For Seshun = 1 To SessionCount
'... and create a list of open sessions...
SessNames = SessNames & CStr(Seshun) & ": " & Extra.sessions.Item(Seshun).Name & Chr(10) & Chr(13)
Next Seshun
End If
Do
'... then present list of those open sessions.
ReturnVal = InputBox(SessNames, "Choose Session")
If ReturnVal = "" Then End 'Cancelled
'Validate Choice - If validation fails, walk 'em through it.
If IsNumeric(ReturnVal) Then
If CInt(ReturnVal) <= SessionCount And CInt(ReturnVal) > 0 Then
ChosenSession = CInt(ReturnVal)
Exit Function
End If
End If
NotFinished = MsgBox("Please enter the number of the appropriate session!", vbOKCancel, "OOPS!") - 2
Loop While NotFinished 'until they pick something correctly or cancel.
End
'That Mike sure is a clever lad.
End Functionthis macro is called from a local install of excel and is trying to get the string from the virtualized passport. i can open 2 sessions of passport, and it sees them properly, but fails on this line:
sht.Cells(1, "A") = Scr.getstring(11, 7, 5)- The local operating system (and hence the macro) can see the application's process, but it can't access the virtualized file system nor the virtualized Registry, so it might not notice that something like "Passport 2007" is sort-of-available on the machine. Also, OLE/DDE calls are not possible into an virtual environment.
You could try to "pull" the Macro into the Virtual Environment. To do so, you could use SoftBar or ACDC or create a Pre-Launch CMD...
Falko - how would a Pre-Launch command work in this instance?? I downloaded softbar, and that works great. kinda skidish about putting out beta in production environment though.

