$$Excel-Macros$$ Re: Saving a txt file to an ftp server

2009-07-21 Thread ju...@thepepeshow.com

Hello MartyH,

I was able to do this by installing NcFTP on my computer.  It is
available here: http://www.ncftp.com/download/.  You want to install
the client (not server.)

Once you install that program, modify the following code to accomplish
saving to an FTP file:

Sub SaveTXT2FTP()
'
' SaveTXT2FTP Macro
'

' ** Declarations **
Dim strFileName As String
Dim strPath As String

Dim strFTPServer As String
Dim strFTPPath As String
Dim strFTPUsername As String
Dim strFTPPassword As String

'  Settings *
strFTPServer = ftp.server.com
strFTPUsername = username
strFTPPassword = my.password
strFTPPath = path

strPath = C:\Users\Publice\Documents\
strFileName = Filename.txt

' * Export to TXT File *
ActiveWorkbook.SaveAs Filename:=strPath  strFileName, _
FileFormat:=xlTextMSDOS

' * Upload to FTP Server **
Shell (C:\Program Files\NcFTP\ncftpput.exe -u   strFTPUsername
 _
 -p   strFTPPassword strFTPServer _
strFTPPath strPath  strFileName)

End Sub

I tested on my computer using Excel 2007 and it worked.  You can copy
and paste the sections into the appropriate place in your code.  The
section Export to TXT File does not have to be copied if you will be
using your own.  However, just make sure you specify the file in the
Settings section.

Please post back if this was helpful, or if you have any issues.

--==)) Justo ((==--

On Jul 20, 4:06 am, MartyH martyn.ho...@gmail.com wrote:
 Hi all,

 I currently have a macro that takes data from a spreadsheet and
 reformats it to a pipe delimited .txt file then saves to a location on
 my C: drive.
 I then manually place the file on an ftp server - is there any way
 that I can save the file direct to the ftp server or move it from my
 C:drive to the ftp server?

 I have read a few articles on API that seem to suggest a solution but
 my VBA understanding isn't quite to the level where I can fully
 undersatnd the code in published examples and thus tweak it to my
 exact requirements.
 Any help would be freatly appreciated.

 Many thanks,

 MartyH

--~--~-~--~~~---~--~~
--
Some important links for excel users:
1. Excel and VBA Tutorials(Video and Text), Free add-ins downloads at 
http://www.excelitems.com
2. Excel tutorials at http://www.excel-macros.blogspot.com
3. Learn VBA Macros at http://www.vbamacros.blogspot.com
4. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 

To post to this group, send email to excel-macros@googlegroups.com
If you find any spam message in the group, please send an email to:
Ayush Jain  @ jainayus...@gmail.com or
Ashish Jain @ 26may.1...@gmail.com

HELP US GROW !!

We reach over 5,000 subscribers worldwide and receive many nice notes about the 
learning and support from the group. Our goal is to have 10,000 subscribers by 
the end of 2009. Let friends and co-workers know they can subscribe to group at 
http://groups.google.com/group/excel-macros/subscribe
-~--~~~~--~~--~--~---



$$Excel-Macros$$ Re: Saving a txt file to an ftp server

2009-07-20 Thread zheng yu
Hi Marty

  I think uplaoding the file to FTP server is not within the range of Excel
vba work. it is the FTP client that does this.

 1) You should have a FTP client that uploads files to server.
 2) There is auto-update function in the FTP client . so once you point the
folder where the file is, then the FTP client will uploads those files in
that folder to FTP server automatically at schedule time.

   There are many free FTP client you can download

   I just think this is easier than doing it in VBA

Cheers

Yu Zheng

On Mon, Jul 20, 2009 at 1:06 PM, MartyH martyn.ho...@gmail.com wrote:


 Hi all,

 I currently have a macro that takes data from a spreadsheet and
 reformats it to a pipe delimited .txt file then saves to a location on
 my C: drive.
 I then manually place the file on an ftp server - is there any way
 that I can save the file direct to the ftp server or move it from my
 C:drive to the ftp server?

 I have read a few articles on API that seem to suggest a solution but
 my VBA understanding isn't quite to the level where I can fully
 undersatnd the code in published examples and thus tweak it to my
 exact requirements.
 Any help would be freatly appreciated.

 Many thanks,

 MartyH



 


--~--~-~--~~~---~--~~
--
Some important links for excel users:
1. Excel and VBA Tutorials(Video and Text), Free add-ins downloads at 
http://www.excelitems.com
2. Excel tutorials at http://www.excel-macros.blogspot.com
3. Learn VBA Macros at http://www.vbamacros.blogspot.com
4. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 

To post to this group, send email to excel-macros@googlegroups.com
If you find any spam message in the group, please send an email to:
Ayush Jain  @ jainayus...@gmail.com or
Ashish Jain @ 26may.1...@gmail.com

HELP US GROW !!

We reach over 5,000 subscribers worldwide and receive many nice notes about the 
learning and support from the group. Our goal is to have 10,000 subscribers by 
the end of 2009. Let friends and co-workers know they can subscribe to group at 
http://groups.google.com/group/excel-macros/subscribe
-~--~~~~--~~--~--~---



$$Excel-Macros$$ Re: Saving a txt file to an ftp server

2009-07-20 Thread Daniel

Hello.
Give a look at the web site :
http://www.bygsoftware.com/Excel/VBA/ftp.htm
Regards.
Daniel

 -Original Message-
 From: excel-macros@googlegroups.com [mailto:excel-
 mac...@googlegroups.com] On Behalf Of MartyH
 Sent: lundi 20 juillet 2009 13:07
 To: MS EXCEL AND VBA MACROS
 Subject: $$Excel-Macros$$ Saving a txt file to an ftp server
 
 
 Hi all,
 
 I currently have a macro that takes data from a spreadsheet and reformats
it
 to a pipe delimited .txt file then saves to a location on my C: drive.
 I then manually place the file on an ftp server - is there any way that I
can
 save the file direct to the ftp server or move it from my C:drive to the
ftp
 server?
 
 I have read a few articles on API that seem to suggest a solution but my
VBA
 understanding isn't quite to the level where I can fully undersatnd the
code
 in published examples and thus tweak it to my exact requirements.
 Any help would be freatly appreciated.
 
 Many thanks,
 
 MartyH
 
 
 
  




--~--~-~--~~~---~--~~
--
Some important links for excel users:
1. Excel and VBA Tutorials(Video and Text), Free add-ins downloads at 
http://www.excelitems.com
2. Excel tutorials at http://www.excel-macros.blogspot.com
3. Learn VBA Macros at http://www.vbamacros.blogspot.com
4. Excel Tips and Tricks at http://exceldailytip.blogspot.com
 

To post to this group, send email to excel-macros@googlegroups.com
If you find any spam message in the group, please send an email to:
Ayush Jain  @ jainayus...@gmail.com or
Ashish Jain @ 26may.1...@gmail.com

HELP US GROW !!

We reach over 5,000 subscribers worldwide and receive many nice notes about the 
learning and support from the group. Our goal is to have 10,000 subscribers by 
the end of 2009. Let friends and co-workers know they can subscribe to group at 
http://groups.google.com/group/excel-macros/subscribe
-~--~~~~--~~--~--~---