Topic "Error with SessionOptions"

Author Message
wademoses
[View user's profile]

Joined: 2017-10-16
Posts: 2
Location: Wisconsin
Using WinSCP 5.11.2 on Windows Server 2016

I just moved from WinSCP 5.9.3 on a Windows Server 2008 R2 which ran the .Net Assembly and COM library beautifully from Access 2010 32-bit (VBA).
Now on a Windows 2016 server with Access 2010 32-bit (VBA), I have tried WinSCP 5.9.3 and 5.11.2 and cannot get past opening the SessionOptions. WinSCP GUI works perfectly when I run it manually (I can connect to multiple FTP sites and transfer files). But using the .Net Assembly/COM files from VBA causes the error below. This appears to me to be an issue with registering the .dll file or adding the Reference to it but I cannot get it to work.

Here is the VBA code:

Dim SessionOptions As New SessionOptions
With SessionOptions <<------------------- Error happens here
.Protocol = Protocol_Sftp
.hostName = vFTPServ
.username = vUser
.password = vPass
.SshHostKeyFingerprint = "ssh-rsa 1024 3a:a8:c2:c0:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:60:be"
End With


Here is the error:

Run-time error '-2146232576 (80131700)':
Automation error

SessionOptions = <Object variable or With block variable not set>

Things I have already tried:
- Registered and Unregistered the .dll files successfully many times using the online examples:

%WINDIR%\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe WinSCPnet.dll /codebase /tlb:WinSCPnet32.tlb
%WINDIR%\Microsoft.NET\Framework64\v4.0.30319\RegAsm.exe WinSCPnet.dll /codebase /tlb:WinSCPnet64.tlb

- Re-selected the Reference to the WinSCP Scripting Interface .Net Wrapper
- Made sure the .dll, .tlb, and WinSCP.exe files are all in the same folder.
- Rebooted the server
- I checked the log file but nothing gets logged this early in the process. (Manually running WinSCP does log connections just fine.)

Help! WinSCP is wonderful when it is working!
Advertisements
martin◆
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 27059
Location: Prague, Czechia
Googling for "error 80131700", it seems that it's related to broken installation of .NET framework. Try to reinstall/fix it.
wademoses
[View user's profile]

Joined: 2017-10-16
Posts: 2
Location: Wisconsin
I just uninstalled .Net 4.7, rebooted, reinstalled .Net 4.7, and re-registered the .DLL for 32 & 64 bit successfully. I am still getting the same error.

Does WinSCP COM need an older version of .Net? .Net 4.7 is the only version I see that is intended to run on Server 2016.
martin◆
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 27059
Location: Prague, Czechia
WinSCP can run on any version of .NET starting with 2.0.
Sorry, I do not know how to help you.
Advertisements

You can post new topics in this forum

Search

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License