Topic "VBA error when trying to assign Session Options"

Author Message
bl4met
[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:
Code:

Dim MySession As New Session
Dim MySessionOptions As New SessionOptions
   
With MySessionOptions
    .Protocol = Protocol_Ftp
    .FtpSecure = FtpSecure_Implicit
    .HostName = "xxx.xxx.xxx.xxx"
    .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
bl4met
[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.
Quote:
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.
- https://msdn.microsoft.com/en-us/library/ee691831.aspx

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 https://winscp.net/tracker/show_bug.cgi?id=869
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24994
Location: Prague, Czechia
You may need to register the WinSCP assembly using 64 version of RegAsm.
https://blogs.msdn.microsoft.com/jigarme/2008/04/28/how-to-register-net-assembly-for-com-interop/
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.
Advertisements

You can post new topics in this forum






Search Site

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