I have the following code I need modified to save a text file to an FTP site. The FTP site is saved to my computer. The current code looks into an existing column for the value "1" and if that exists, the code captures the data in a cell several columns over. Then it pops up a save dialog.
What I want to happen is that the file is saved automatically without the dialog box to an FTP site.
This is the file path:
ftp://[login to view URL]
This has been attempted by someone with basic VBA skills, but he ran into a problem saving to an FTP site.
Currently, when the Save dialogue box opens and I try to save to the FTP site I get this error:
"Bad file name or number"
The code is below:
Dim r As Range
Dim c As Range
Dim OutputFileNum As Integer
Dim PathName As String
Dim RowNum As Integer
Dim SheetValues() As Variant
Dim filePathVariant As Variant
' displays the save file dialog
filePathVariant = [login to view URL]( _
FileFilter:="Text Files (*.txt), *.txt")
' checks to make sure the user hasn't canceled the dialog
If filePathVariant <> False Then
PathName = filePathVariant
OutputFileNum = FreeFile
Open PathName For Output Lock Write As #OutputFileNum
Set r = [login to view URL]([login to view URL]("AX8"), [login to view URL]("AW8").End(xlDown))
For Each c In [login to view URL]
If [login to view URL] = 50 And [login to view URL] = 1 Then
Print #OutputFileNum, [login to view URL]([login to view URL], 41).Value
10 pekerja bebas membida secara purata €131 untuk pekerjaan ini
VBA is a obsolete technology. You should use VB.Net or C# to create program which can solve your problem easily. Thanks. Relevant Skills and Experience C#, Vb.Net programmer. Proposed Milestones €200 EUR - Milestone