I have a macro that runs 14 file transfers with Relection Workspace connecting to AS400 machines. I automated the macro with Visual Basic to run when an Outlook reminder kicks off. It has worked great for years. Yesterday, I got a new computer and now the macro doesn't run without some manual intervention. The macro runs the first file transfer and then is stuck.
What I found in Task Manager is that when Reflection is opened, it opens Attachmate.Emulation.Frame (32) bit in Apps. Normally when the macro closed Reflections, this app is closed and no longer shows in Task Manager.
On the new machine, this App doesn't close and the macro is unable to continue. If I manually close the App in Task Manager, the macro continues. I have to do this each time it completes a file transfer.
Below is the code for one of the file transfers:
Sub Branch_Admin_To_L_Regional_No_AUXRABAll_Closed()
Dim Session As Reflection.Session
Set Session = CreateObject("ReflectionIBM.Session")
Session.SetupSession rc5250Terminal, rc31792, rcTelnet
vUID400 = "A778833ODBA"
With Session
.SetNumeric rcXfr400Transport, rcLIPITCP
.SetString rcHostName, "CENTRAL"
.SetString rcAPPNNetID, ""
.SetString rcLocationName, ""
.SetString rcUserName, vUID400
.SetString rcPassword, vPW400
.SetNumeric rcSingleSignOn, rcNo
.SetNumeric rcTelnetUseSocks, rcNo
.SetString rcModeName, "QPCSUPP"
.SetString rcFQRemoteLu, ""
.SetString rcSNADomainSuffix, ""
.SetString rcMPTNIPAddress, ""
.SetNumeric rcXfrSpacesToUnderscores, rcYes
.SetNumeric rcXfrUnderscoresToSpaces, rcYes
.SetNumeric rcXfrReceive8Dot3, rcNo
.SetNumeric rcXfr8Dot3FilenameCase, rcLowerCase
.SetNumeric rcXfr400ExistsAction, rcAppend
.SetNumeric rcXfr400UseDescriptionFile, rcYes
.SetNumeric rcXfr400SaveDescriptionFile, rcNo
.SetNumeric rcXfr400SendConversion, rcAS400DIF
.SetNumeric rcXfr400ReceiveConversion, rcAS400CommaDelim
.SetNumeric rcXfr400HostFileType, rcAS400Data
.SetNumeric rcXfr400Authority, rcAuthReadwrite
.SetNumeric rcXfr400RecordLength, rcAS400DefaultRecLen
.SetNumeric rcXfr400TimeFormat, rcAS400TimeDFT
.SetNumeric rcXfr400DateFormat, rcAS400DateDFT
.SetNumeric rcXfr400TimeSeparator, rcAS400Default
.SetNumeric rcXfr400DateSeparator, rcAS400Default
.SetNumeric rcXfr400IgnoreDecErrors, rcNo
.SetNumeric rcXfr400ReturnMissing, rcYes
.SetNumeric rcXfr400DecSep, rcAS400WinDefault
.SetNumeric rcXfr400OutputDest, rcAS400File
.SetString rcXfr400FileText, ""
.SetString rcXfr400MemberText, ""
.SetString rcXfr400SendDescFile, "R:\My Doc\pt101pup1.FDF"
.SetString rcXfr400ReceiveDescFile, "*.FDF"
.SetString rcXfr400LocalFile, "X:\NA\7799\branch_officesAll.csv"
.SetString rcXfr400RemoteFile, "ellib/offdrb, ellib/auxdrb, ellib/pt102p, ellib/pt100p, ellib/pt102p01,ellib/offwwd"
.SetString rcXfr400SortSeq, "*JOB"
.SetString rcXfr400RefFile, ""
.SetNumeric rcXFR400Objects, rcRepMemberConf
.SetNumeric rcXfr400ShowProgress, rcYes
.SetNumeric rcXfr400Charset, rcAS400ANSICS
.SetNumeric rcXfr400DeleteTrailingSpaces, rcYes
.SetString rcXfrCurrentDirectory, "R:\my documents"
.SetNumeric rcXfr400StartRecord, rcDefaultStartRecord
.SetNumeric rcXfr400NCS, rcUSEnglish
.SetNumeric rcXfr400CompatibleFDFFile, rcNo
.SetNumeric rcXfr400AssumePositiveNumerics, rcNo
.SetString rcAS400LinkName, ""
.SetNumeric rcXfr400HostTP, rcLIPI
.SetNumeric rcXfr400ForceHexConversion, rcYes
.SetNumeric rcXfr400CompatibleAsciiFile, rcNo
.SetNumeric rcXfrCloseDlgAfterTransfer, rcNo
'.SetSQLStatement rcAS400Select, "t1.ODBGP, t1.ODBBR, t4.PT0GPT, t4.PT0BU, t3.PT2DPT, t3.PT2PRD, t1.ODBRGN, CONCAT(t1.ODBRGN, t1.ODBRGN) , t5.PT2DPT, t5.PT2PRD, t"
.SetSQLStatement rcAS400Select, "t1.ODBGP, t1.ODBBR, t4.PT0GPT, t4.PT0BU, t3.PT2DPT, t3.PT2PRD, t1.ODBRGN, t1.ODBRGN||t1.ODBRGN, t5.PT2DPT, t5.PT2PRD, t"
.AppendSQLStatement rcAS400Select, "1.ODBMID, t1.ODBBAC, t1.ODBBAD, t6.WWOSRG, t6.WWOCTC, t6.WWOARE,t1.ODBBDR,t1.ODBSTS"
.SetSQLStatement rcAS400Where, "t1.ODBRGN <> ' ' AND t2.AUXRAB = ' ' AND (t1.ODBBDR = 'N' and t1.ODBBLE = 'N' and t1.ODBBSE = 'N' and t1.ODBBUC = 'N' "
.AppendSQLStatement rcAS400Where, "and t1.ODBBAD = 'N' and t1.ODBBWH = 'N' and t1.ODBBAC = 'N') "
.SetSQLStatement rcAS400OrderBy, "t1.ODBGP , t1.ODBBR"
.SetSQLStatement rcAS400GroupBy, ""
.SetSQLStatement rcAS400Having, ""
.SetSQLStatement rcAS400JoinBy, "t1.ODBGP = t2.AUXGP AND t1.ODBGP = t3.PT2OGP AND t1.ODBBR = t2.AUXBR AND t1.ODBBR = t3.PT2OBR AND t1.ODBGP = t4.PT0OGP AND t2."
.AppendSQLStatement rcAS400JoinBy, "AUXGP = t5.PT2OGP AND CONCAT(t1.ODBRGN,t1.ODBRGN) = t5.PT2OBR AND t1.ODBGP = t6.WWOGRP AND t1.ODBBR = t6.WWOBRN"
.SetNumeric rcXfr400ExistsAction, rcAppend
.XfrCurrentDirectory = "R:\my doc"
.Xfr400RemoteFile = "ellib/offdrb,ellib/auxdrb,ellib/pt102p,ellib/pt100p,ellib/pt102p01,ellib/offwwd"
.Xfr400LocalFile = "F:\Groups\\AutoMonarch\Translate\branch_officesAll.csv"
.PCSReceiveFile "", True
.Exit
End With
End Sub
Do you see anything wrong? I've checked the references on the new and old machines and they are the same. I'm not sure where to go from here or what to try next. Thanks for your help......