This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
data_import [2016/12/03 12:57] geelling created |
data_import [2017/02/20 16:50] (current) |
||
---|---|---|---|
Line 17: | Line 17: | ||
One simply way to use SFTP to upload files is from within an macro (see VBA sample code below). This will allow you to generate and upload a .csv file directly from an Excel spreadsheet. You can download the pscp.exe command line SFTP client from http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html | One simply way to use SFTP to upload files is from within an macro (see VBA sample code below). This will allow you to generate and upload a .csv file directly from an Excel spreadsheet. You can download the pscp.exe command line SFTP client from http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html | ||
- | ''Public Sub SftpPut() | + | If you wish to use the SFTP upload feature, please contact cuForms for login credentials. |
+ | |||
+ | <code> | ||
+ | Public Sub SftpPut() | ||
Const cstrSftp As String = """C:\[filepath]\pscp.exe""" | Const cstrSftp As String = """C:\[filepath]\pscp.exe""" | ||
Dim strCommand As String | Dim strCommand As String | ||
Line 26: | Line 29: | ||
Dim pRemotePath As String | Dim pRemotePath As String | ||
- | pUser = "u79662320-moneywise" | + | pUser = "username" |
- | pPass = "xGM88ySvqsMJkS7p" | + | pPass = "password" |
- | pHost = "home559766521.1and1-data.host" | + | pHost = "hostname" |
- | pFile = Application.DefaultFilePath & "\focus.csv" | + | pFile = Application.DefaultFilePath & "\99999.csv" |
pRemotePath = "/" | pRemotePath = "/" | ||
Line 36: | Line 39: | ||
Debug.Print strCommand | Debug.Print strCommand | ||
Shell strCommand, 1 ' vbNormalFocus ' | Shell strCommand, 1 ' vbNormalFocus ' | ||
- | End Sub'' | + | End Sub |
+ | </code> |