Re: VBA Excel 2010 64bit hangs
I'm sorry, but I do not know how to help you further.
- <Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
- <System>
<Provider Name=".NET Runtime" />
<EventID Qualifiers="0">1023</EventID>
<Level>2</Level>
<Task>0</Task>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2016-03-03T16:33:33.000000000Z" />
<EventRecordID>85015</EventRecordID>
<Channel>Application</Channel>
<Computer>CTS</Computer>
<Security />
</System>
- <EventData>
<Data>.NET Runtime version 2.0.50727.5485 - CLR: Fatal Execution Engine Error (000007FEED75600A) (80131506)</Data>
</EventData>
</Event>
With statement to separate statements?
.Protocol = WinSCPnet.Protocol_Sftp syntax. Did you try .Protocol = Protocol_Sftp, as documented?
why does the code hang on the next statement?
What statement?
With mySessionOptions
.Protocol = WinSCPnet.Protocol_Sftp
.HostName = "hostname"
.UserName = "******"
.Password = "******"
.SshHostKeyFingerprint = "ssh-rsa 2048 ce:f2:d5:05:e0:36:63:e1:**:**:**:c0:16:ba:06:72"
End With
why does the code hang on the next statement?
the mySession and mySessionOptions variables are never set
What does that mean? Does the code even compile/run? Or does it fail on run time? With what error?
the mySession and mySessionOptions variables are never set
try
{
# Load WinSCP .NET assembly
Add-Type -Path "c:\Program Files (x86)\WinSCP\WinSCPnet.dll"
# Setup session options
$sessionOptions = New-Object WinSCP.SessionOptions -Property @{
Protocol = [WinSCP.Protocol]::Sftp
HostName = "hostname"
UserName = "*****"
Password = "*****"
SshHostKeyFingerprint = "ssh-rsa 2048 ce:f2:d5:05:e0:36:63:e1:**:**:**:c0:16:ba:06:72"
}
$session = New-Object WinSCP.Session
try
{
# Connect
$session.Open($sessionOptions)
# Upload files
$transferOptions = New-Object WinSCP.TransferOptions
$transferOptions.TransferMode = [WinSCP.TransferMode]::Binary
$transferResult = $session.PutFiles("d:\util\junkfolder\*", "/var/lib/user/junkfolder/", $False, $transferOptions)
# Throw on any error
$transferResult.Check()
# Print results
foreach ($transfer in $transferResult.Transfers)
{
Write-Host ("Upload of {0} succeeded" -f $transfer.FileName)
}
}
finally
{
# Disconnect, clean up
$session.Dispose()
}
exit 0
}
catch [Exception]
{
Write-Host $_.Exception.Message
exit 1
}
Sub TransferFolder()
On Error GoTo SPC_err
' Setup session options