PDA

View Full Version : [SOLVED] Help with Procedure to View Web Page



Tenspeed39355
02-19-2005, 10:35 AM
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 (http://etfconnect.com/)"
Columns(1).ColumnWidth = 50
End Sub

Max:hi:

Paleo
02-19-2005, 11:13 AM
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

Tenspeed39355
02-19-2005, 01:18 PM
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

johnske
02-19-2005, 07:20 PM
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 (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

Tenspeed39355
02-19-2005, 08:32 PM
John Thanks that will work for me. Again thanks

Max

Tenspeed39355
02-19-2005, 08:34 PM
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

johnske
02-20-2005, 12:41 AM
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 :cool: