Topic "Excel VBA sessionoption object returns Activex cannot create object error"

Author Message
karthiknsra
[View user's profile]

Joined: 2016-01-29
Posts: 6
Location: MK
Hi,

I have recently registered the winscpnet.dll using .NET Framework C:\Windows\Microsoft.NET\Framework64\v2.0.50727. And I have added the tlb file generated to my VBA references. But when I try to instantiate sessionoptions object, it throws an error "Activex cannot create object". Not sure what went wrong here. Could you please guide.

Regards
Karthik
Advertisements
karthiknsra
[View user's profile]

Joined: 2016-01-29
Posts: 6
Location: MK
Can someone please help me here as this is really critical at the moment for me
karthiknsra
[View user's profile]

Joined: 2016-01-29
Posts: 6
Location: MK
I just found that I was able to connect using vbscript. And if I use VBA, it is not working. Can anyone suggest the problem.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
My answer to your duplicate post on Stack Overflow:
http://stackoverflow.com/q/35091706/850848

Quote:
The Microsoft Excel is 32-bit application, so you probably have to register the WinSCPnet.dll for 32-bit .NET framework, even on 64-bit system.

As the instructions for registering the WinSCP .NET assembly for COM shows, on 64-bit system, you generally need to register the assembly both for 32-bit and 64-bit:

Code:
%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


Do not add the .tbl manually to Excel. The assembly appears itself after being registered correctly.
karthiknsra
[View user's profile]

Joined: 2016-01-29
Posts: 6
Location: MK
Thank you so much. This resolved the problem.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
karthiknsra wrote:
Thank you so much. This resolved the problem.

You are welcome. Can you accept my answer on Stack Overflow to close the question?
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