WinSCP in VBA Excel Error: ActiveX component cannot create

Advertisement

Perhogan
Donor
Joined:
Posts:
10
Location:
Germany

WinSCP in VBA Excel Error: ActiveX component cannot create

I was able to register the dll for usage in VBA but when i try to run the example script you provide in the documentation i get this error :(

Run-time error 429
ActiveX component cannot create object

the original code can be found here:
https://winscp.net/eng/docs/library_vb#example

the error happens once executing this line:

Dim mySession As New Session

or if i split the command in two part dim and set at the line

Set mySession = New Session


Any clue?

Reply with quote

Advertisement

Perhogan
Donor
Joined:
Posts:
10
Location:
Germany

solved.

I guess i Registered the COM for 32 bit on 64 bit machine therefore it was not working.
re-registering now works!

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,378
Location:
Prague, Czechia

Perhogan wrote:

I guess i Registered the COM for 32 bit on 64 bit machine therefore it was not working.
re-registering now works!
How do you register it for 64 bit as opposite to 32 bit?

Reply with quote

Perhogan
Donor
Joined:
Posts:
10
Location:
Germany

Disclaimer: i'm not an expert so i might say bullshit :-)

i have 2 subfolders folders in the microsoft .net folder , one named Framework and the other Framework64
plus i have a second PC (virtual machine) that works 32 bit and only has the Framework folder.

so in the end on the normal machine i can use both these commands
%WINDIR%\Microsoft.NET\Framework\<version>\RegAsm.exe WinSCP.dll /codebase /tlb
%WINDIR%\Microsoft.NET\Framework64\<version>\RegAsm.exe WinSCP.dll /codebase /tlb

while on the virtual machine only this
%WINDIR%\Microsoft.NET\Framework\<version>\RegAsm.exe WinSCP.dll /codebase /tlb


on the normal machine i had an error while registering with Ver 4 so in the end i tried all the combination of 64 and 32 bit v2 and v4.
So i don't know which one was in the end registered. The final result was that i could load the module in excel but they were not properly working giving me the error.

I then thought it might be an excel 2010 64 bit related issue and i decider to try it on the Excel 2007 of the virtual machine. It worked without any problem

so i went back on Excel 2010 64 bit reinstalled everything from scratch (WinSCP reinstall) and registering it again (i did it with the framework 64 only. v2 only was working while v4 still give error), this time the code worked properly...

Considering all this I came to my guessing of the 64 bit registering issue. I know it might however relate to something else, the important thing is that it works now :-).

Reply with quote

Advertisement

You can post new topics in this forum