Consulting

Results 1 to 10 of 10

Thread: IE WEBSITE FILE UPLOAD

  1. #1
    VBAX Regular
    Joined
    Jun 2014
    Posts
    12
    Location

    IE WEBSITE FILE UPLOAD

    Dear All,

    VBA code for https://imgsafe.org/ to click +browsefile button then auto add file with location i.e. 'C:\Image.jpg' and press Open button after it select upload button for uploading image and copy and paste image name i.e. "https://i.imgsafe.org/95646ec.jpg" in excel cell.

    Regards.

    MJI



  2. #2
    Site Admin
    Jedi Master
    VBAX Guru Jacob Hilderbrand's Avatar
    Joined
    Jun 2004
    Location
    Roseville, CA
    Posts
    3,712
    Location
    Can you clarify the issue you are having?

  3. #3
    VBAX Regular
    Joined
    Jun 2014
    Posts
    12
    Location
    Quote Originally Posted by Jacob Hilderbrand View Post
    Can you clarify the issue you are having?
    1.VBA to open https://imgsafe.org and press Browsefile button as per following picture highlighted
    STEP1.JPG
    2.After above vba to put file name with location for uploading and press OPEN button as per next image
    STEP2.JPG
    3.After 2nd step vba click UPLOAD button as per picture highlighted
    step3.JPG

    4.Then 3rd step vba paste image link in excel sheet1 A1 cell as per following picture
    step4.JPG


    Regards
    MJI

  4. #4
    VBAX Regular
    Joined
    Jun 2014
    Posts
    12
    Location
    I done 1st step and also can done 3rd step through last codes

    Sub imagesafe()
         Dim ie As Object
         Dim tags As Object
         Dim tagx As Object
        Set ie = CreateObject("InternetExplorer.Application")
                    ie.navigate "https://imgsafe.org/"
            ie.Visible = True
            Do While ie.Busy And Not ie.readyState = 4
                DoEvents
            Loop
            Do While ie.Busy And Not ie.readyState = 4
            DoEvents
        Loop
    Application.Wait (Now + TimeValue("00:00:05"))
     Set elementcol = ie.document.getelementsbytagname("input")
               For Each btninput In elementcol
        If btninput.getattribute("id") = "fileupload" Then
    btninput.Click
    End If
         Next btninput
         End Sub

    need to know how done 2nd and 4 step
    Last edited by Aussiebear; 05-26-2016 at 05:25 PM. Reason: Added hash tags to code

  5. #5
    VBAX Regular
    Joined
    Jun 2014
    Posts
    12
    Location
    ADDED FOLLOWING BUT NOT WORKED


    Application.Wait (Now + TimeValue("00:00:05"))
               Set ElementCol = ie.Document.getElementsbytagname("input")
            For Each btnInput In ElementCol
    If btnInput.getattribute("name") = "files[]" Then
            btnInput.Value = "C:\Users\abc\Desktop\Safari\Africa-Tanzania-Migration-1-sunset.jpg"
    btnInput.FireEvent ("onclick")
    End If
    Next btnInput
    Last edited by Aussiebear; 05-26-2016 at 05:26 PM. Reason: Added hash tags to code

  6. #6
    Site Admin
    Jedi Master
    VBAX Guru Jacob Hilderbrand's Avatar
    Joined
    Jun 2004
    Location
    Roseville, CA
    Posts
    3,712
    Location
    Ok at this point does the image download? Once it is downloaded you could have the macro insert the image from your computer.

  7. #7
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,107
    Location
    Any reason why the lines

    Do While ie.Busy And Not ie.readyState = 4
    DoEvents
    Loop
    Are duplicated?
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

  8. #8
    VBAX Regular
    Joined
    Jun 2014
    Posts
    12
    Location
    Dear Jacob,

    In post No.3 available in STEP WISE

    and i need to how macro perform step 2 and 4



    Regards.

  9. #9
    VBAX Regular
    Joined
    Jun 2014
    Posts
    12
    Location
    sorry mistaken

  10. #10
    VBAX Regular
    Joined
    Jun 2014
    Posts
    12
    Location
    no solution ?

Posting Permissions

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