0

I'm trying to download a file from a ftp site and populate an Excel spreadsheet with it. I'm barely familiar with VBA, but I've figured out enough that I know I need to use WinHTTP, or would if this was on a PC. Anyone know a workaround for a Mac? If not is there another way to get a text file downloaded and opened in excel?

Sub SourceTextToFile(url As String, toFile As String)
    Dim Request As New WinHttpRequest
    Dim ff As Integer
    Request.Open "GET", url, False
    Request.Send

    ff = FreeFile
    Open toFile For Output As #ff
    Print #ff, Request.ResponseText
    Close #ff
End Sub
Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
user2361820
  • 441
  • 3
  • 9
  • 18

1 Answers1

0

See the Query-Tables answer on this question

How can I send an HTTP POST request to a server from Excel using VBA?

Link to the specific answer:

https://stackoverflow.com/a/4617566/1709223

Community
  • 1
  • 1
jrwagz
  • 586
  • 6
  • 15