Topic "VBA error when trying to assign Session Options"

Author Message
[View user's profile]

Joined: 2012-10-22
Posts: 3
Location: Iowa
I have some code VBA code that creates a CSV file in Excel and the uploads the file to an FTP server. This code works great on WinXP Excel 2007. IT just upgraded me to Win7 64-bit and Excel 2010 64-bit.
Now when i try to run the code I get an error 429 "ActiveX component can't create object" when i try to run it. I'm running WinSCP 5.1 with the same .Net assembly/COM Lib. getting it registered was a pain but I was able to gt that done after modifying the RegAsm.exe.config to allow for network installations even though it was a local install. Am I just missing the the .NET/COM doesn't work on 64 bit systems or am i just missing something stupid?

This is the code where it breaks:
Dim MySession As New Session
Dim MySessionOptions As New SessionOptions
With MySessionOptions
    .Protocol = Protocol_Ftp
    .FtpSecure = FtpSecure_Implicit
    .HostName = ""
    .UserName = "xxx"
    .Password = "xxx"
    .portnumber = 990
    .sslhostcertificatefingerprint = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
End With

MySession.Open MySessionOptions

It lets me declare the variable and and it stops with the "With MySessionOptions" I have the .NET/COM listed in references and even tried WinSCP.Session and WinSCP.SessionOptions without success. It could possibly be a office 2010 and/or 64bit issue that I'm missing. I'm looking into that as well but was wondering if anyone else has run into anything like that.

Any help will be greatly appreceated
[View user's profile]

Joined: 2012-10-22
Posts: 3
Location: Iowa
Running through MSDN trying to find an answer there I came across somthing that I belive answers my question.
Native 64-bit processes in Office 2010 cannot load 32-bit binaries. This includes the common controls of MSComCtl (TabStrip, Toolbar, StatusBar, ProgressBar, TreeView, ListViews, ImageList, Slider, ImageComboBox) and the controls of MSComCt2 (Animation, UpDown, MonthView, DateTimePicker, FlatScrollBar).These controls were installed by previous versions of Microsoft Office and are installed by 32-bit Office 2010. An alternative must be found for existing Microsoft Office VBA solutions that utilize these controls when the code is migrated to 64-bit Office 2010. 64-bit Office 2010 does not provide 64-bit versions of the Common Controls.

so sadly unless there is a 64bit version of the .NET assembly/COM library that Im not finding looks like this is my answer
Most likely to be related to this bug
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26911
Location: Prague, Czechia
You may need to register the WinSCP assembly using 64 version of RegAsm.
Please, let me know, if it helped or not!

The assembly itself target Any CPU, so it should work both on 32 and 64 bit. Though I have not really tested that.

You can post new topics in this forum


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!


About donations

$9   $19   $49   $99

About donations


WinSCP Privacy Policy

WinSCP License