Topic "WinSCP.dll Registration issues - want to use with VBA"

Author Message
sy27295
[View user's profile]

Joined: 2013-12-04
Posts: 12
Location: Boston, USA
I did install the COM interface files, etc. at the same place as the WinSCP.exe

This is a 64 bit machine with Office 2010 x64. Want to program in VBA

Tried to register both ways RegAsm.exe [first] (as follows at the bottom and it worked)...for WinSCPNet is now in Excel Tools | References list. But I want WinSCP.dll registered.

But I want to see WinSCP.dll interface, not WinSCPNet.dll
Tried ...windows\system32\regsvr32.exe for WinSCP.dll; but it gives an error.... "..WinSCO.dll was loaded but the entry-point DllRegisterServer was not found.

What am I doing wrong?
Should I delete the RegAsm.exe registration and try RegSvr32 first?

U:\>%WINDIR%\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe "C:\Program Files (x86)\WinSCP\WinSCP.dll" /codebase /tl
Microsoft .NET Framework Assembly Registration Utility version 4.0.30319.17929
for Microsoft .NET Framework version 4.0.30319.17929
Copyright (C) Microsoft Corporation. All rights reserved.

Types registered successfully
Assembly exported to 'C:\Program Files (x86)\WinSCP\WinSCP.tlb', and the type library was registered successfully
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
sy27295 wrote:
But I want WinSCP.dll registered.

What do you mean by "registered"? That's what regasm does.

Quote:
But I want to see WinSCP.dll interface, not WinSCPNet.dll

What do you mean by "WinSCP.dll interface" as opposite to WinSCPNet.dll? Do you want to use 5.1.x instead of 5.2.x? Note that both versions behave the same in terms on "registration" (for COM).

Quote:
Tried ...windows\system32\regsvr32.exe for WinSCP.dll; but it gives an error.... "..WinSCO.dll was loaded but the entry-point DllRegisterServer was not found.

regsvr32 cannot be used for .NET assemblies. That's what regasm is for.
_________________
Martin Prikryl
sy27295
[View user's profile]

Joined: 2013-12-04
Posts: 12
Location: Boston, USA
Good points.
This is what I want to do .... from Excel and its own VBA; but get Error 429, which means it cannot CreateObject
Not calling from .NET and Assembly, etc.
Set session = CreateObject("WinSCP.Session")
Set session = CreateObject("WinSCPNet.Session")
...assuming that the COM registered ProgramId is one of the above.

Similar to this; similar to what you do from VBScript
Set oFs = CreateObject("Scripting.FileSystemObject")

Tools References dialog box in Excel shows (Type Library?)
[x] WinSCP console interface .NET wrapper

I was hoping to see something without the .NET, as non of my other references (ie. other Microsoft COM products, MapPoint, Outlook), they don't need Framework.

I was under the impression that there is WSP Com Wrapper (uses RegSvr.exe/RegSvr32.exe) and also a .NET wrapper (using RegAsm.exe)

Wonder if this is a "location or environment variables" issue.... but everything is in one folder - the installation folder of WSP (the .exe, the .dll, the .tlb)
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
Ok, so you obviously need to start with this:
https://winscp.net/eng/docs/library_vb
(particularly regarding object instantiation)
sy27295
[View user's profile]

Joined: 2013-12-04
Posts: 12
Location: Boston, USA
No, no, no..... with all due respect (btw: Thank you so much for doing all this work + highest respect for your talents, etc.)

Looks like the current COM wrapper is actually a .NET wrapper (with Framework assemblies)

There is also Type Library /.dll wrappers (Pre .NET days).... where you could create an object (say VBScript/VBA without the Office Interop) without the need for Framework or VS.

Check your Excel .....steps:
- Excel
- Alt/F11 (you will see the code)
- Tools
- References

Then this code in a Module should have worked without a 429 error
sub testingWinScpObject
Set session = CreateObject("WinSCP.Session")
end sub
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
WinSCP .NET assembly is .NET assembly Wink with COM support.
So it behaves like a COM library when it comes to Excel VBA.
I do not know about the CreateObject approach (I know it works in VBScript, haven't tested it in VBA).
But as for the New Session approach, this works for me (tested this myself from Excel VBA).
That's all I can tell.
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