Latest News

the latest news from our team

MPE File Transfer (MDMFT) and VBA

The MdmFT in VBA Session

The MdmFT session can be called from any Visual Basic
for Applications (VBA) application.

Sub FTSession()
'Exists Action
Const gcCancel = 0
Const gcReplace = 1
Const gcPrompt = 2
Const gcAppend = 3

'Direction
Const gcUpload = 0
Const gcDownload = 1

'File Type
Const gcASCII = 0
Const gcBinary = 1

Dim FTSession As Object

On Error GoTo Egress1
Set FTSession = CreateObject("NetFT.Session")
FTSession.HostAddress = "support.minisoft.com"
FTSession.Port = 30001
FTSession.LoginUser = "neal"
FTSession.LoginAccount = "minisoft"
FTSession.UserPassword = InputBox("User Password")

If (Not FTSession.Connect) Then
MsgBox "1 - " & FTSession.ErrorMessage
GoTo Egress1
End If

FTSession.DisplayStats = True
FTSession.Direction = gcDownload
FTSession.LocalFile = "TestFile"
FTSession.TransferMode = gcASCII
FTSession.HostFile = "INSTINFO.MM.MINISOFT"
If (FTSession.StartTransfer <> 0) Then
MsgBox "3 - " & FTSession.ErrorMessage
GoTo Egress1
End If
GoTo Egress2

Egress1:
MsgBox "Error Exit"

Egress2:
If FTSession.ConnectStatus = True Then
FTSession.Disconnect
End If
Set FTSession = Nothing

End Sub

Leave a Reply

Your email address will not be published. Required fields are marked *