+ Reply to Thread
Results 1 to 11 of 11

file download log in

Hybrid View

  1. #1
    Registered User
    Join Date
    04-12-2012
    Location
    LA
    MS-Off Ver
    Excel 2011
    Posts
    8

    file download log in

    I am using the following code to get a file:

    Dim FileData() As Byte
        Set WHTTP = CreateObject("WinHTTP.WinHTTPrequest.5.1")
        
        WHTTP.Open "GET", myurl, False
        WHTTP.send
        FileData = WHTTP.responseBody
        Set WHTTP = Nothing
        FileNum = FreeFile
    
        Open "D:\bla.txt" For Binary Access Write As #FileNum
            Put #FileNum, 1, FileData
        Close #FileNum
    It works really fast but the problem is that I have to log in to that website so that I can download the file, is there a way to do so?
    Last edited by arlu1201; 08-01-2012 at 10:00 AM.

  2. #2
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,239

    Re: file download log in

    Possibly, but it depends on the website. Without seeing it, there's no real way of advising you

  3. #3
    Registered User
    Join Date
    04-12-2012
    Location
    LA
    MS-Off Ver
    Excel 2011
    Posts
    8

    Re: file download log in

    yahoo.com is the website I need to be logged into. Thanks

  4. #4
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: file download log in

    Excelfrogs,

    Welcome to the forum.

    I have added code tags to your post. As per forum rule 3, you need to use them whenever you put any code in your post. Please add them in future. If you need more information on how to use them, check my signature.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  5. #5
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,239

    Re: file download log in

    I'd need more than that I'm afraid.

    The winHTTPObject does support the passing of credentials, I suggest you read up on it and see how far you get, but don't hold your breath

    ---------- Post added at 03:34 PM ---------- Previous post was at 03:31 PM ----------

    Oh, and please don't crosspost

  6. #6
    Registered User
    Join Date
    04-12-2012
    Location
    LA
    MS-Off Ver
    Excel 2011
    Posts
    8

    Re: file download log in

    Any other method you would recommend perhaps?

  7. #7
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,239

    Re: file download log in

    I don't think you're going to find one, not easily at any rate. It will be a lot of trial and error and you'd need a good understanding of web technologies

  8. #8
    Registered User
    Join Date
    04-12-2012
    Location
    LA
    MS-Off Ver
    Excel 2011
    Posts
    8

    Re: file download log in

    dang it!!!

  9. #9
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,239

    Re: file download log in

    I suppose you could work around by automating ie, but honestly whilever you're logged into the site, doing it the way you're doing it would be just as fast

  10. #10
    Registered User
    Join Date
    04-12-2012
    Location
    LA
    MS-Off Ver
    Excel 2011
    Posts
    8

    Re: file download log in

    yes but the way i'm doing it it's impossible because i need to be logged in, so i will have to fine another way that downloads it in the background

  11. #11
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,239

    Re: file download log in

    Whichever way you're doing it, you're going to have to log in at some point

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1