Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default access to a server via a macro

I manually upload a results sheet to a server - I want to be able to do this
via a macro.
1. Save a particular page as a web page with a pop up for the sheet name

2. Open the FTP server programme and log on using a user name and password

3. Select upload, within the FTP programme, of the file created in '2'

4. Close the ftp programme

Can this be done? Thanks in anticipation
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default access to a server via a macro

in the IDE, set a Reference to the 'Microsoft Internet Transfer Control 6.0'
control ( usually C:\Windows\System32\msinet.ocx)

having saved the fille first , now you can send it...

Public Sub FTPtheFile(sFileName As String)
Dim oFTP As FFTPController

sFileName = sRNG_TPFILE

Set oFTP = New FFTPController
With oFTP
.URL = sFTP_URL
.Login = sFTP_USER
.Password = sFTP_PWD
.SourceFile = sFileName
.TargetPath = sFTP_PATH
.Show vbModal
If .FileSent Then
MsgBox "Sent at " & Now()
End If
End With
Unload oFTP

End Sub




"Gwyndalf" wrote:

I manually upload a results sheet to a server - I want to be able to do this
via a macro.
1. Save a particular page as a web page with a pop up for the sheet name

2. Open the FTP server programme and log on using a user name and password

3. Select upload, within the FTP programme, of the file created in '2'

4. Close the ftp programme

Can this be done? Thanks in anticipation

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default access to a server via a macro

as i copied the code from one of my own code modules, i obviously left some
rubbish in...now its fixed. sorry

"Patrick Molloy" wrote:

in the IDE, set a Reference to the 'Microsoft Internet Transfer Control 6.0'
control ( usually C:\Windows\System32\msinet.ocx)

having saved the file first , now you can send it...

Public Sub FTPtheFile(sFileName As String)
Dim oFTP As FFTPController
Set oFTP = New FFTPController
With oFTP
.URL = sFTP_URL
.Login = sFTP_USER
.Password = sFTP_PWD
.SourceFile = sFileName
.TargetPath = sFTP_PATH
.Show vbModal
If .FileSent Then
MsgBox "Sent at " & Now()
End If
End With
Unload oFTP
End Sub




"Gwyndalf" wrote:

I manually upload a results sheet to a server - I want to be able to do this
via a macro.
1. Save a particular page as a web page with a pop up for the sheet name

2. Open the FTP server programme and log on using a user name and password

3. Select upload, within the FTP programme, of the file created in '2'

4. Close the ftp programme

Can this be done? Thanks in anticipation

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 16
Default access to a server via a macro

Patrick

Many thanks for your replly; hadn't realised any replies had returned -
hence delay in response.

Can you explain the 'IDE' area where I should reference msinet.ocx?

I usually use a 3rd party FTP uploader (FTP Surfer [Whisper technologies])
was unaware that MS had one built in. (Which is what I assume your code is
using)

My current programme produces the HTML file with a filename based on the
date from a cell within a spreadsheet ie apr24.htm. and saves it in my
documents. Your first line is Sub FTPthe File(sFileName As String) - will
this be requesting the user to input the filename? Since my programme
already knows what the name will be can I not use that information already to
simply upload that file from the saved destination address?

Very grateful for your assistance

"Patrick Molloy" wrote:

as i copied the code from one of my own code modules, i obviously left some
rubbish in...now its fixed. sorry

"Patrick Molloy" wrote:

in the IDE, set a Reference to the 'Microsoft Internet Transfer Control 6.0'
control ( usually C:\Windows\System32\msinet.ocx)

having saved the file first , now you can send it...

Public Sub FTPtheFile(sFileName As String)
Dim oFTP As FFTPController
Set oFTP = New FFTPController
With oFTP
.URL = sFTP_URL
.Login = sFTP_USER
.Password = sFTP_PWD
.SourceFile = sFileName
.TargetPath = sFTP_PATH
.Show vbModal
If .FileSent Then
MsgBox "Sent at " & Now()
End If
End With
Unload oFTP
End Sub




"Gwyndalf" wrote:

I manually upload a results sheet to a server - I want to be able to do this
via a macro.
1. Save a particular page as a web page with a pop up for the sheet name

2. Open the FTP server programme and log on using a user name and password

3. Select upload, within the FTP programme, of the file created in '2'

4. Close the ftp programme

Can this be done? Thanks in anticipation

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How To Access Thru News Server trip_to_tokyo[_3_] Excel Discussion (Misc queries) 3 January 13th 10 09:16 PM
Access to Server folders Fred Excel Programming 1 December 8th 06 02:20 AM
Grrrrr.... can't access Server object ??!!?? [email protected] Excel Programming 2 September 22nd 06 08:00 PM
Export from Access/SQL Server JIM Excel Discussion (Misc queries) 0 August 20th 06 08:09 PM
ado connection to access vs. sql server? Loane Sharp Excel Programming 7 November 16th 04 05:08 PM


All times are GMT +1. The time now is 11:33 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"