Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old August 27th, 2012, 03:53 AM
Registered User
Join Date: Aug 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default VB internet control issue, help!


I have an issue with vb internet control. Am getting an Access Denied error msg even tho I have ticked the reference 'Microsoft Internet Controls'. This reference points to C:\Windows\SysWOW64\ieframe.dll, whereas I think the code I am using needs this to point to shdocvw.dll.

The code I am using is the following, can anyone tell me why this is not working with the above references ticked. And more importantly how should i change the below code to work with the new windows7 64 bit reference:

thx in advance. Russ

Option Explicit

Private IE As Object
Dim t As Date

Sub StartTimer()
If t <> CDate(0) Then Exit Sub
Call xscores
End Sub

Sub StopTimer()
On Error Resume Next
Application.OnTime EarliestTime:=t, Procedure:="xscores", Schedule:=False
t = CDate(0)
Call DisconnectFrom
On Error GoTo 0
End Sub

Private Function NavigateTo(strURL As String)
If IE Is Nothing Then Set IE = CreateObject("InternetExplorer.Application")

With IE
.Visible = False
.Navigate strURL
Do Until (.ReadyState = 4 And Not .Busy): DoEvents: Loop

End With
End Function
Private Function DisconnectFrom()
Set IE = Nothing
End Function

Sub xscores()
Application.ScreenUpdating = False
Dim strURL As String
Dim ieDoc As Object
Dim AllTables As Object
Dim xTable As Object
Dim myWkSht As Worksheet
Dim TblRow As Object
Dim tblCell As Object

Dim r As Integer
Dim c As Integer
Columns("N:O").NumberFormat = "@"
strURL = "http://xscores.com/LiveScore.do?state=soccer&sport=1"

If t = CDate(0) Then
Call NavigateTo(strURL)
End If

Set ieDoc = IE.Document
Set AllTables = ieDoc.frames(3).Document.frames(1).Document.getEle mentsByTagName("TABLE")
Set xTable = AllTables.Item(0)
Set myWkSht = ThisWorkbook.Sheets("Sheet1")

r = 0
c = 0

For Each TblRow In xTable.Rows
r = r + 1
For Each tblCell In TblRow.Cells
c = c + 1
myWkSht.Cells(r, c) = tblCell.innerText
Next tblCell
c = 0
Next TblRow
r = 0

Dim rng As Range
For Each rng In Range(Sheets(1).Range("A1"), Sheets(1).Range("A65536").End(xlUp))

If rng.Text = "K/O" Then
rng.Offset(0, 3).Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
rng.Offset(0, 8).Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
rng.Offset(0, 16).Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
End If
Next rng

'Call DisconnectFrom
't is set at 1 minute intervals
t = Now() + TimeValue("00:01:00")
Application.OnTime EarliestTime:=t, Procedure:="xscores", Schedule:=True
Application.ScreenUpdating = True
End Sub

Similar Threads
Thread Thread Starter Forum Replies Last Post
Internet Explorer Issue wndy26 BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 2 June 23rd, 2004 11:11 PM
Help w/Internet Control in VB.NET jagged30net Pro VB.NET 2002/2003 1 May 29th, 2004 02:33 AM
Help w/Internet Control in VB.NET jagged30net VB.NET 0 December 17th, 2003 10:51 PM
internet explorer issue ak Classic ASP Basics 2 September 29th, 2003 04:00 AM
Internet Transfer Control jake VB How-To 5 July 28th, 2003 04:59 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.