I am trying to transfer a file in myExtra 7.11 from the mainframe to my desktop using VBA in Excel. My first step was to simply use myExtra's macro recorder while I did the transfer. The part of the macro that initiates the transfer is as follows:
' This section of code contains the recorded events
Sess0.FileTransferScheme = "C:\Program Files\Attachmate\E!E2K\Schemes\ENU\Text Default.eis"
Sess0.FileTransferHostOS = 1
Sess0.ReceiveFile "C:\Documents and Settings\T78384\Desktop\DOWNLOADS\EXPORTED.TXT","T78384.EXP.DATA"
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
System.TimeoutValue = OldSystemTimeout
' This code was added to give VBA something to look for when the macro is done.
Sess0.screen.PutString "DONE", 10, 1
When I call the above macro through the shell, it works reliably. Now I need to move this code into VBA. I switched out the line that calls the macro with the following code:
'Sess0 is the same object as in myExtra Basic
Sess0.FileTransferScheme = "C:\Program Files\Attachmate\E!E2K\Schemes\ENU\Text Default.eis"
Sess0.FileTransferHostOS = 1
Sess0.ReceiveFile "C:\Documents and Settings\T78384\Desktop\DOWNLOADS\EXPORTED.TXT", "T78384.EXP.DATA"
For some reason, the same code doesn't work anymore! It doesn't give me any errors compiling or running. I've tried filling it up with all sorts of delays, and that doesn't affect it. Finally, I tried stepping through it with F8. It just gets to ReceiveFile and continues on without any feedback at all.
Any ideas?
' This section of code contains the recorded events
Sess0.FileTransferScheme = "C:\Program Files\Attachmate\E!E2K\Schemes\ENU\Text Default.eis"
Sess0.FileTransferHostOS = 1
Sess0.ReceiveFile "C:\Documents and Settings\T78384\Desktop\DOWNLOADS\EXPORTED.TXT","T78384.EXP.DATA"
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
System.TimeoutValue = OldSystemTimeout
' This code was added to give VBA something to look for when the macro is done.
Sess0.screen.PutString "DONE", 10, 1
When I call the above macro through the shell, it works reliably. Now I need to move this code into VBA. I switched out the line that calls the macro with the following code:
'Sess0 is the same object as in myExtra Basic
Sess0.FileTransferScheme = "C:\Program Files\Attachmate\E!E2K\Schemes\ENU\Text Default.eis"
Sess0.FileTransferHostOS = 1
Sess0.ReceiveFile "C:\Documents and Settings\T78384\Desktop\DOWNLOADS\EXPORTED.TXT", "T78384.EXP.DATA"
For some reason, the same code doesn't work anymore! It doesn't give me any errors compiling or running. I've tried filling it up with all sorts of delays, and that doesn't affect it. Finally, I tried stepping through it with F8. It just gets to ReceiveFile and continues on without any feedback at all.
Any ideas?