Post a reply

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)


Topic review


Sorry Martin

after further playing around with my example code I discovered my error (an uninitialized variable within my method); as often, just a copy/paste error :evil:

After the small correction, the code runs perfectly !

Thanks a lot for your efficient support :D

Friendly regards


PeBoe wrote:

I'm working with Excel 2003 SP3

I would not expect this to differ between 2003 and 2010.
Anyway, can you post your complete code?

Sorry, forgot to add: using VBA

I'm working with Excel 2003 SP3

Re: COM library putFiles giving error on VBA

Your code works for me in VBA 7.0 (Excel 2010). Are you using VBA or VB?

COM library putFiles giving error on VBA


I'm trying to use the COM object in VBA; after successful creation and initialization of a session object which I call m_session I try:

Dim transferResult As TransferOperationResult
transferResult = m_session.putFiles(localPath, remotePath)

also tried:
set transferResult = m_session.putFiles(localPath, remotePath)

But I always get an Error: "object reference not set to an instance of an object"

NOTE: I know m_session is OK, because when using it with m_session.ExecuteCommand('any UNIX cmd') it works fine

Working with:
Microsoft Windows XP Professional; Version 5.1.2600 Service Pack 3 Build 2600
Microsoft Visual Basic 6.5
WinSCP 5.1.7
WinSCP COM Assemmbly 5.1.7

Thanks for your help