Hello!
First of all thanks to all of you who come here to answer questions, I (and I'm sure many of us) appreciate what you all do.
That being said, I've become stumped on a problem and after searching the internet for a while I still haven't been able to figure it out. I have a macro that I've written that deals with mainframe. The goal of the snippet of code we're looking for help with today is to have the mainframe FTP a generic file from mainframe to the PC. To do so we have excel open mainframe as an object in its own function (Far earlier in the same macro, as there are many other things we have this macro do than ftp the file) and simply send the object whenever we call a new sub that needs ran. This works successfully for other subs in the same macro. When we get to this sub however we have a problem. In the below code, we get a Run-time error '438': Object doesn't support this property or method for line ss.navigateto "ftpmacro.zmc".
Rather than calling a new macro as shown in the longer section of code below, we also attempted to have the code run a toolbar command which also received the same error. The command we attempted to send was
ss.ReceiveFile ("GenericSharedFolderLocation MainframeFileName ASCII CRLF")
GenericSharedFolderLocation being the place we intend to initially send the file, the MainframeFileName is the output file inside mainframe we want to ftp over. If we do this as it's own macro in the proper screen on mainframe (macro through a notepad and the run macro functionality on the mainframe emulator) it works successfully. When we try to have excel run this same code through the object we get the same error (ss.ReceiveFile...)
Does anyone know why this error keeps occurring here, and if so how to fix it? Or alternatively does anyone know how to force a mainframe object to ftp a file from mainframe to pc through excel?
Thank you all for your time.
Call ConnectToPassport(ss)
Call SendFile(userID, Filekey, ss)
Sub SendFile(userID, Filekey, ss)
Dim FSO
Dim sFile As String
Dim Text
Dim Ret
sFile = "GenericSharedFolderLocation" & Filekey
Set FSO = CreateObject("Scripting.FileSystemObject")
If FSO.FileExists(sFile) Then
FSO.DeleteFile sFile, True
End If
ss.navigateto "ftpmacro.zmc"
MyTargetFolder = "C:\PersonalFolderLocation" & Filekey
Name "GenericSharedFolderLocation" As MyTargetFolder
Kill ("GenericSharedFolderLocation")
End Sub
Function ConnectToPassport(ss)
Set System = CreateObject("PASSPORT.System")
If System Is Nothing Then
Exit Function
End If
Set Sessions = System.Sessions
If Sessions Is Nothing Then
Exit Function
End If
Set sess0 = System.ActiveSession
If sess0 Is Nothing Then
Exit Function
End If
If Not sess0.Visible Then sess0.Visible = True
Set ss = sess0.Screen
End Function
Bookmarks