ftp通过vba转移? [英] ftp transfer by vba ?

查看:84
本文介绍了ftp通过vba转移?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有人知道是否有可能通过vba进行ftp文件传输?

我想到的是vba中的例程或宏将会例如将我的数据库或部分数据库转移到备份站点

Does anyone know if its possible to make a ftp-file transfer by vba?
What I have in mind is a routine in vba or a macro wich will e.g. transfer my database or parts of it to a back-up site

推荐答案

我刚刚在上周完成了一个这样的实际操作:)


这不是太简单但肯定是可能的。让我挖掘一些细节。
I just finished implementing one this last week in fact :)

It''s not too simple but is certainly possible. Let me dig up some details.


我从工作簿的隐藏工作表中的两个命名范围开始。克拉(^)表示以下字符应指示替换字符串。

^ A = FTP站点上的帐户名称

^ C =添加可选cd行的占位符在FTP文件中,如果需要 - 如果没有设置为空行

^ F =上传所需文件的名称

^ N = FTP文件的名称(不包括.Ftp位) ) - 为了简单起见,也将此用于CMD文件

^ P = ^ A的密码

^ R =根文件夹 - 在

^ S = FTP站点地址


文件本身的数据包括在下面。我需要相当大的灵活性。如果你不是那么你可以用硬编码项替换可变位。
范围(CMD)
I start off with two named ranges in a hidden sheet of my workbook. Carats (^) indicate that the following character should indicate a replacement string.
^A = Account name on FTP site
^C = A placeholder to add an optional cd line in FTP file if required - If not set to empty line
^F = Name of file required to upload
^N = Name of FTP file (excluding the .Ftp bit) - Use this for CMD file too for simplicity
^P = Password for ^A
^R = Root Folder - the folder that the spreadsheet is found in
^S = FTP site address

The data for the files themselves are included below. I needed a fair amount of flexibility. If you don''t then you can replace the variable bits with hard coded items.
Range("CMD")
展开 | 选择 | Wrap | 行号


Thanx NeoPa为您的答案。我是新手,所以我还没有完全掌握它,但在问更多愚蠢的问题之前我会更多地回答你的答案。

我肯定我我会回答更多问题。

现在谢谢。


Chris
Thanx NeoPa for your answer. I''m a novice, so I don''t fully grasp it yet, but before asking more dumb questions I''m going to dig in your answer some more.
I''m sure I''ll be back with further questions.
Thanks for now.

Chris


这篇关于ftp通过vba转移?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆