Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

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?
karthiknsra

Thank you so much. This resolved the problem.
martin

Re: Excel VBA sessionoption object returns Activex cannot create object error

My answer to your duplicate post on Stack Overflow:
https://stackoverflow.com/q/35091706/850848

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:

%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

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.
karthiknsra

Can someone please help me here as this is really critical at the moment for me
karthiknsra

Excel VBA sessionoption object returns Activex cannot create object error

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