Consulting

Results 1 to 7 of 7

Thread: Help with Procedure to View Web Page

  1. #1

    Help with Procedure to View Web Page

    When I run this macro the web page comes up but it is distorted.
    What am I doing wrong.

    Sub OpenHTMLpage()
    'set the URL you want below
    Application.Workbooks.Open "http://etfconnect.com"
    Columns(1).ColumnWidth = 50
    End Sub
    Max

  2. #2
    Administrator
    VP-Knowledge Base
    VBAX Master
    Joined
    Jan 2005
    Location
    Porto Alegre - RS - Brasil
    Posts
    1,219
    Location
    Max,

    your code seems to be right. The problem is that its pointing to a non html page, thats why you get some distortion.

    Look at this KB for more details: http://www.vbaexpress.com/kb/getarticle.php?kb_id=295
    Best Regards,

    Carlos Paleo.

    To every problem there is a solution, even if I dont know it, so this posting is provided "AS IS" with no warranties.

    If Debugging is harder than writing a program and your code is as good as you can possibly make
    it, then by definition you're not smart enough to debug it.




    http://www.mugrs.org

  3. #3
    Ok I understand that it is not opening to a html page. How can I get a non html page to open in my ss?
    Max

  4. #4
    Administrator
    Chat VP VBAX Guru johnske's Avatar
    Joined
    Jul 2004
    Location
    Townsville, Australia
    Posts
    2,872
    Location
    Hi tenspeed,

    The point in opening a web page as a s/s is basically to use it to do something like (say) search for something on that page and not merely to just view it.

    This particular page comes up (albeit distorted) so you can still search (or whatever). If you play around with the column widths (drag them in or out) you may probably be able to remove the distortion - for THAT site - if you visit that site often, you can then put the column widths into your procedure and that's fine - but for that site...

    If you simply want an undistorted view of it, you'd be better off calling up IE >

    Sub ConnectToETF()
    Dim ie As Object
    Set ie = CreateObject("InternetExplorer.Application")
    On Error GoTo 1
    With ie
    .Navigate "http://etfconnect.com"
    .Visible = True
    End With
    Set ie = Nothing
    Exit Sub
    1: MsgBox Err.Description
    ie.Quit
    Set ie = Nothing
    End Sub
    HTH,
    John
    You know you're really in trouble when the light at the end of the tunnel turns out to be the headlight of a train hurtling towards you

    The major part of getting the right answer lies in asking the right question...


    Made your code more readable, use VBA tags (this automatically inserts [vba] at the start of your code, and [/vba ] at the end of your code) | Help those helping you by marking your thread solved when it is.

  5. #5
    John Thanks that will work for me. Again thanks

    Max

  6. #6
    John I have tried to find the place on VBA to give you a rating. How do I get to the place
    where I can give you a rating?? Good job and thanks for your time.

    Max

  7. #7
    Administrator
    Chat VP VBAX Guru johnske's Avatar
    Joined
    Jul 2004
    Location
    Townsville, Australia
    Posts
    2,872
    Location
    Hi Max, my pleasure.

    (it's up the top of the thread near "Thread tools" - where you can also mark your thread as solved - under "Rate thread")

    Regards,
    John
    You know you're really in trouble when the light at the end of the tunnel turns out to be the headlight of a train hurtling towards you

    The major part of getting the right answer lies in asking the right question...


    Made your code more readable, use VBA tags (this automatically inserts [vba] at the start of your code, and [/vba ] at the end of your code) | Help those helping you by marking your thread solved when it is.

Posting Permissions

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