VBA error when trying to assign Session Options

Advertisement

bl4met
Joined:
Posts:
3
Location:
Iowa

VBA error when trying to assign Session Options

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 = "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

Reply with quote

Advertisement

bl4met
Joined:
Posts:
3
Location:
Iowa

Answer found, kinda

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.
- https://learn.microsoft.com/en-us/office/client-developer/shared/compatibility-between-the-32-bit-and-64-bit-versions-of-office
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/869

Reply with quote

Advertisement

You can post new topics in this forum