Skip to main content

Code To Transfer File In VBA

  • May 11, 2017
  • 2 replies
  • 0 views

I have automated transferring a file in EXTRA! but my code (see below) does not work in Reflection Desktop.

No error messages appear when this is run. It just sits.

Any assistance is GREATLY appreciated!

DSN = userid ".jclextrc." FullName ExtensionName
DSN = "'" DSN "'"
FTP = False
Do Until FTP = True
Sess0.FileTransferScheme = "Text Default"
Sess0.FileTransferHostOS = 1
DSNDestination = DestPath FullName ".TXT"
Application.Wait (Now TimeValue("0:00:01"))
Recv = Sess0.ReceiveFile(DSNDestination, DSN) ' '(DSNDestination,DSN)
Lag = False
Do Until Lag = True
If Recv Then
FTP = True
Lag = True
End If
Application.Wait (Now TimeValue("0:00:02"))
Loop
Loop


#Reflection
#Desktop

2 replies

I have automated transferring a file in EXTRA! but my code (see below) does not work in Reflection Desktop.

No error messages appear when this is run. It just sits.

Any assistance is GREATLY appreciated!

DSN = userid ".jclextrc." FullName ExtensionName
DSN = "'" DSN "'"
FTP = False
Do Until FTP = True
Sess0.FileTransferScheme = "Text Default"
Sess0.FileTransferHostOS = 1
DSNDestination = DestPath FullName ".TXT"
Application.Wait (Now TimeValue("0:00:01"))
Recv = Sess0.ReceiveFile(DSNDestination, DSN) ' '(DSNDestination,DSN)
Lag = False
Do Until Lag = True
If Recv Then
FTP = True
Lag = True
End If
Application.Wait (Now TimeValue("0:00:02"))
Loop
Loop


#Reflection
#Desktop
gdcrane,

It appears that in the past few days you have not received a response to your
posting. That concerns us, and has triggered this automated reply.

These forums are peer-to-peer, best effort, volunteer run and that if your issue
is urgent or not getting a response, you might try one of the following options:

- Visit https://www.microfocus.com/support-and-services and search the knowledgebase and/or check
all the other self support options and support programs available.
- Open a service request: https://www.microfocus.com/support
- You could also try posting your message again. Make sure it is posted in the
correct newsgroup. (http://forums.microfocus.com)
- You might consider hiring a local partner to assist you.
https://www.partnernetprogram.com/partnerfinder/find.html

Be sure to read the forum FAQ about what to expect in the way of responses:
http://forums.microfocus.com/faq.php

Sometimes this automatic posting will alert someone that can respond.

If this is a reply to a duplicate posting or otherwise posted in error, please
ignore and accept our apologies and rest assured we will issue a stern reprimand
to our posting bot.

Good luck!

Your Micro Focus Forums Team
http://forums.microfocus.com



I have automated transferring a file in EXTRA! but my code (see below) does not work in Reflection Desktop.

No error messages appear when this is run. It just sits.

Any assistance is GREATLY appreciated!

DSN = userid ".jclextrc." FullName ExtensionName
DSN = "'" DSN "'"
FTP = False
Do Until FTP = True
Sess0.FileTransferScheme = "Text Default"
Sess0.FileTransferHostOS = 1
DSNDestination = DestPath FullName ".TXT"
Application.Wait (Now TimeValue("0:00:01"))
Recv = Sess0.ReceiveFile(DSNDestination, DSN) ' '(DSNDestination,DSN)
Lag = False
Do Until Lag = True
If Recv Then
FTP = True
Lag = True
End If
Application.Wait (Now TimeValue("0:00:02"))
Loop
Loop


#Reflection
#Desktop
Are you doing this in an Extra! Basic macro I presume? an .ebm file? These are compatible with Reflection Desktop.

Extra! file transfers with ReceiveFile are IND$FILE transfers, not FTP. Did you edit the "Text Default" scheme to use FTP instead of IND$FILE?

You don't have to do special waiting routines with ReceiveFile - your program will wait until the file transfer completes - it is a synchronous function.

Try taking out all the looping and waiting stuff - just set the file transfer properties and do the RecieveFile. success?

Documentation for the Extra! API