Consulting

Results 1 to 4 of 4

Thread: Open a txt file

  1. #1

    Open a txt file

    I need to open a txt file by clicking on the excel logo below on a website. Is it possible for excel vba to accomplish?



    Thanks in advance for your help.

  2. #2
    VBAX Tutor
    Joined
    Mar 2014
    Posts
    210
    Location
    VBA can open a text file, but what does your question mean? click a logo on the spreadsheet?????

  3. #3
    Quote Originally Posted by ranman256 View Post
    VBA can open a text file, but what does your question mean? click a logo on the spreadsheet?????

    The logo is on a website. Thanks for your response

  4. #4
    VBAX Tutor
    Joined
    Mar 2014
    Posts
    210
    Location
    I get my text from website using :

    Function ExecuteWebRequest(ByVal url As String) As String
    Dim oXHTTP As Object
    If InStr(1, url, "?", 1) <> 0 Then
        url = url & "&cb=" & Timer() * 100
    Else
        url = url & "?cb=" & Timer() * 100
    End If
    Set oXHTTP = CreateObject("MSXML2.XMLHTTP")
    oXHTTP.Open "GET", url, False
    oXHTTP.send
    ExecuteWebRequest = oXHTTP.responseText
    Set oXHTTP = Nothing
    End Function

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •