Topic "WinSCP in VBA Excel Error: ActiveX component cannot create"

Author Message
Perhogan
[View user's profile]
Donor
Joined: 2012-05-16
Posts: 10
Location: Germany
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 Sad

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:

Code:

Dim mySession As New Session


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

Code:

Set mySession = New Session


Any clue?
Advertisements
Perhogan
[View user's profile]
Donor
Joined: 2012-05-16
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!
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24991
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?
_________________
Martin Prikryl
Perhogan
[View user's profile]
Donor
Joined: 2012-05-16
Posts: 10
Location: Germany
Disclaimer: i'm not an expert so i might say bullshit Smile

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

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

%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 Smile.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24991
Location: Prague, Czechia
Thanks, I'll check.
_________________
Martin Prikryl
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