Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OLE error

Status
Not open for further replies.

thegame8311

Technical User
Jan 6, 2012
133
US
After I run the following code several times I get an OLE unspecified error

Code:
* use the ie browser
oIE2 = createobject("internetexplorer.application")
* to navigate to a web page of interest
oIE2.navigate2("[URL unfurl="true"]http://www.nfl.com/stats/categorystats?tabSeq=1&statisticPositionCategory=QUARTERBACK&qualified=true&season=2011&seasonType=REG")[/URL]
* wait for the page to load
Do While oIE2.readystate<>4
   Doevents
ENDDO

newHandle = FCREATE('C:\new.txt')

* extract the net text:
*oIE.Document.body.innertext*
x = oIE2.Document.body.innertext
FWRITE(newHandle, x)

FCLOSE(newHandle)

is there a what to delete the object or kill the process after running the code above, because otherwise it leaves those processes open, and I am testing some other code after it, so the iexplorer process needs to close or terminate
 
have you tried

oIE2 = nothing

HTH << MaZeWorX >> "I have not failed I have only found ten thousand ways that don't work" <<Edison>>
 
Yes but that does not terminate the iexplore.exe process, I use a taskkill in the command prompt and manually release the processes

so is there any other way, that I can do this and the end of my program?
 
What about this ?
oIE2.Quit

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Your existing code does not look quite like VBA. Try this in a UserForm.

Private Sub CommandButton1_Click()

Dim oIE2 As Object

Set oIE2 = CreateObject("internetexplorer.application")
oIE2.navigate2 (" Do While oIE2.readystate <> 4
DoEvents
Loop
Label1.Caption = oIE2.Document.body.innertext

oIE2.Quit

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top