Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 279
Default Watchdog timer issues

I am using XL 2003.

I have a need to run Internet Explorer for about 20k URLs.
This is beyond the capacity of IE on my system.
I use a 30 second watchdog timer to detect IE becoming unreasonably slow.

Relevant code is:

' Needs Tools/References/Microsoft Internet Controls
Public ie As SHDocVw.InternetExplorer

Private killtime As Date
Private Const killduration As String = "00:00:30"
....
Private Sub kill_ie()
Debug.Print now & " kill_ie() called"
killtime = 0
Set ie = Nothing
End Sub

Public Function Wait4IEretry(ByVal operation As String) As Boolean
....

On Error GoTo newie
....
killtime = now + TimeValue(killduration)
Application.OnTime EarliestTime:=killtime, Procedu="kill_ie", Schedule:=True
Wait4IE operation
Application.OnTime EarliestTime:=killtime, Procedu="kill_ie", Schedule:=False

If False Then
newie:
If killtime < 0 Then
On Error Resume Next ' ontime may not be set
Application.OnTime EarliestTime:=killtime, Procedu="kill_ie", Schedule:=False
End If

Set ie = Nothing
Resume retry
Stop
retry:
' Stop
Wait4IEretry = False
Exit Function
End If
....
Wait4IEretry = True
Exit Function
.....
End Function

So Wait4IEretry starts a 3o second watchdog timer on Wait4IE completing
in 30 seconds.

If 30 seconds elapses, kill_ie is called and ie is made nothing, causing
Wait4IE to complete with an error and transfer control to label newie.
I find "On Error Resume Next" ineffective against errors in Application.OnTime.
I zero killtime in kill_ie so Application.OnTime is not called.
If I hit escape to allow me to save my XL file, Application.OnTime is called and errors.
Why is "On Error Resume Next" ineffective?

If 30 seconds does not elapse, the timer is cancelled without problem.

I can't work out how to make killduration a date.
In the immediate debug window, I see
?#00:00:30#
00:00:30
?timevalue("00:00:30")
00:00:30

In the debug code window,
Private Const killduration As Date = #00:00:30#
is transformed into
Private Const killduration As Date = #12:00:30 AM#

As an sside, many cells in my worksheet have a small triangle marking
their upper left corner. I remember that as meaning there is some
strangeness about the data in the marked cells. I just can't
work out how to Google it.
excel cell warning message is ineffective.
excel cell triangle corner suggests a formula error and that a trace
error button should appear - it does not - the cells contain values.
Unsetting Tools/Options/Error checking/Number stored as text
causes those triangles to vanish and I now know what the issue is.
How to I get "Number stored as text" to appear as a warning?
--
Walter Briscoe
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,182
Default Watchdog timer issues

Walter,

Try...

Private Const vKillET = "00:00:30"

...and in your function...

killtime = TimeValue(Now) + TimeValue(vKill_ET)
'returns time in hh:mm:ss AM/PM

Also, in your function you might want to def a var to hold the boolean
value used in your If..Then block. It can be set True as a default
unless a condition toggles it false...

Dim bMyVar As Boolean
bMyVar = True '//assume success

'//some code that preserves or toggles bMyVar

If Not bMyVar Then
newie:
...

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,182
Default Watchdog timer issues

Not sure why you're automating IE since most things it does can be
accessed directly via APIs with no wait time!

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion
  #4   Report Post  
Banned
 
Posts: 8
Default

Quote:
Originally Posted by Walter Briscoe View Post
I am using XL 2003. I have a need to run Internet Explorer for about 20k URLs. This is beyond the capacity of IE on my system. I use a 30 second watchdog timer to detect IE becoming unreasonably slow. Relevant code is: ' Needs Tools/References/Microsoft Internet Controls Public ie As SHDocVw.InternetExplorer Private killtime As Date Private Const killduration As String = &quot;00:00:30&quot; .... Private Sub kill_ie() Debug.Print now &amp; &quot; kill_ie() called&quot; killtime = 0 Set ie = Nothing End Sub Public Function Wait4IEretry(ByVal operation As String) As Boolean .... On Error GoTo newie .... killtime = now + TimeValue(killduration) Application.OnTime EarliestTime:=killtime, Procedu=&quot;kill_ie&quot;, Schedule:=True Wait4IE operation Application.OnTime EarliestTime:=killtime, Procedu=&quot;kill_ie&quot;, Schedule:=False If False Then newie: If killtime &lt;&gt; 0 Then On Error Resume Next ' ontime may not be set Application.OnTime EarliestTime:=killtime, Procedu=&quot;kill_ie&quot;, Schedule:=False End If Set ie = Nothing Resume retry Stop retry: ' Stop Wait4IEretry = False Exit Function End If .... Wait4IEretry = True Exit Function ..... End Function So Wait4IEretry starts a 3o second watchdog timer on Wait4IE completing in 30 seconds. If 30 seconds elapses, kill_ie is called and ie is made nothing, causing Wait4IE to complete with an error and transfer control to label newie. I find &quot;On Error Resume Next&quot; ineffective against errors in Application.OnTime. I zero killtime in kill_ie so Application.OnTime is not called. If I hit escape to allow me to save my XL file, Application.OnTime is called and errors. Why is &quot;On Error Resume Next&quot; ineffective? If 30 seconds does not elapse, the timer is cancelled without problem. I can't work out how to make killduration a date. In the immediate debug window, I see ?#00:00:30# 00:00:30 ?timevalue(&quot;00:00:30&quot;) 00:00:30 In the debug code window, Private Const killduration As Date = #00:00:30# is transformed into Private Const killduration As Date = #12:00:30 AM# As an sside, many cells in my worksheet have a small triangle marking their upper left corner. I remember that as meaning there is some strangeness about the data in the marked cells. I just can't work out how to Google it. excel cell warning message is ineffective. excel cell triangle corner suggests a formula error and that a trace error button should appear - it does not - the cells contain values. Unsetting Tools/Options/Error checking/Number stored as text causes those triangles to vanish and I now know what the issue is. How to I get &quot;Number stored as text&quot; to appear as a warning? -- Walter Briscoe
Xin lỗi th*y cô đã luôn quan tâm v* dạy tôi những điều hay lẽ phải, dạy tôi những thứ không 1 admin n*o có thể dạy em như: sống trên đời phải biết bao dung, nhân loại với nhau không nên thanh lọc lẫn nhau, copy v* paste l* 2 th*nh tựu khoa học h*ng đầu thế giới v* được các chuyên gia h*ng đầu về tin học tin dùng.
  #5   Report Post  
Banned
 
Posts: 8
Default

Quote:
Originally Posted by Walter Briscoe View Post
I am using XL 2003. I have a need to run Internet Explorer for about 20k URLs. This is beyond the capacity of IE on my system. I use a 30 second watchdog timer to detect IE becoming unreasonably slow. Relevant code is: ' Needs Tools/References/Microsoft Internet Controls Public ie As SHDocVw.InternetExplorer Private killtime As Date Private Const killduration As String = &quot;00:00:30&quot; .... Private Sub kill_ie() Debug.Print now &amp; &quot; kill_ie() called&quot; killtime = 0 Set ie = Nothing End Sub Public Function Wait4IEretry(ByVal operation As String) As Boolean .... On Error GoTo newie .... killtime = now + TimeValue(killduration) Application.OnTime EarliestTime:=killtime, Procedu=&quot;kill_ie&quot;, Schedule:=True Wait4IE operation Application.OnTime EarliestTime:=killtime, Procedu=&quot;kill_ie&quot;, Schedule:=False If False Then newie: If killtime &lt;&gt; 0 Then On Error Resume Next ' ontime may not be set Application.OnTime EarliestTime:=killtime, Procedu=&quot;kill_ie&quot;, Schedule:=False End If Set ie = Nothing Resume retry Stop retry: ' Stop Wait4IEretry = False Exit Function End If .... Wait4IEretry = True Exit Function ..... End Function So Wait4IEretry starts a 3o second watchdog timer on Wait4IE completing in 30 seconds. If 30 seconds elapses, kill_ie is called and ie is made nothing, causing Wait4IE to complete with an error and transfer control to label newie. I find &quot;On Error Resume Next&quot; ineffective against errors in Application.OnTime. I zero killtime in kill_ie so Application.OnTime is not called. If I hit escape to allow me to save my XL file, Application.OnTime is called and errors. Why is &quot;On Error Resume Next&quot; ineffective? If 30 seconds does not elapse, the timer is cancelled without problem. I can't work out how to make killduration a date. In the immediate debug window, I see ?#00:00:30# 00:00:30 ?timevalue(&quot;00:00:30&quot;) 00:00:30 In the debug code window, Private Const killduration As Date = #00:00:30# is transformed into Private Const killduration As Date = #12:00:30 AM# As an sside, many cells in my worksheet have a small triangle marking their upper left corner. I remember that as meaning there is some strangeness about the data in the marked cells. I just can't work out how to Google it. excel cell warning message is ineffective. excel cell triangle corner suggests a formula error and that a trace error button should appear - it does not - the cells contain values. Unsetting Tools/Options/Error checking/Number stored as text causes those triangles to vanish and I now know what the issue is. How to I get &quot;Number stored as text&quot; to appear as a warning? -- Walter Briscoe
Mới gọi lên nh* mạng hỏi mạng hôm nay bị cái éo gì ấy, đăng stt facebook cả mấy tiếng rồi ko thấy ai like


  #6   Report Post  
Banned
 
Posts: 8
Default

Quote:
Originally Posted by Walter Briscoe View Post
I am using XL 2003. I have a need to run Internet Explorer for about 20k URLs. This is beyond the capacity of IE on my system. I use a 30 second watchdog timer to detect IE becoming unreasonably slow. Relevant code is: ' Needs Tools/References/Microsoft Internet Controls Public ie As SHDocVw.InternetExplorer Private killtime As Date Private Const killduration As String = &quot;00:00:30&quot; .... Private Sub kill_ie() Debug.Print now &amp; &quot; kill_ie() called&quot; killtime = 0 Set ie = Nothing End Sub Public Function Wait4IEretry(ByVal operation As String) As Boolean .... On Error GoTo newie .... killtime = now + TimeValue(killduration) Application.OnTime EarliestTime:=killtime, Procedu=&quot;kill_ie&quot;, Schedule:=True Wait4IE operation Application.OnTime EarliestTime:=killtime, Procedu=&quot;kill_ie&quot;, Schedule:=False If False Then newie: If killtime &lt;&gt; 0 Then On Error Resume Next ' ontime may not be set Application.OnTime EarliestTime:=killtime, Procedu=&quot;kill_ie&quot;, Schedule:=False End If Set ie = Nothing Resume retry Stop retry: ' Stop Wait4IEretry = False Exit Function End If .... Wait4IEretry = True Exit Function ..... End Function So Wait4IEretry starts a 3o second watchdog timer on Wait4IE completing in 30 seconds. If 30 seconds elapses, kill_ie is called and ie is made nothing, causing Wait4IE to complete with an error and transfer control to label newie. I find &quot;On Error Resume Next&quot; ineffective against errors in Application.OnTime. I zero killtime in kill_ie so Application.OnTime is not called. If I hit escape to allow me to save my XL file, Application.OnTime is called and errors. Why is &quot;On Error Resume Next&quot; ineffective? If 30 seconds does not elapse, the timer is cancelled without problem. I can't work out how to make killduration a date. In the immediate debug window, I see ?#00:00:30# 00:00:30 ?timevalue(&quot;00:00:30&quot;) 00:00:30 In the debug code window, Private Const killduration As Date = #00:00:30# is transformed into Private Const killduration As Date = #12:00:30 AM# As an sside, many cells in my worksheet have a small triangle marking their upper left corner. I remember that as meaning there is some strangeness about the data in the marked cells. I just can't work out how to Google it. excel cell warning message is ineffective. excel cell triangle corner suggests a formula error and that a trace error button should appear - it does not - the cells contain values. Unsetting Tools/Options/Error checking/Number stored as text causes those triangles to vanish and I now know what the issue is. How to I get &quot;Number stored as text&quot; to appear as a warning? -- Walter Briscoe
Được l*m cmt đầu tiên tôi cảm thấy rất l* hạnh phúc v* rất l* hồi hộp.
  #7   Report Post  
Banned
 
Posts: 8
Default

Quote:
Originally Posted by Walter Briscoe View Post
I am using XL 2003. I have a need to run Internet Explorer for about 20k URLs. This is beyond the capacity of IE on my system. I use a 30 second watchdog timer to detect IE becoming unreasonably slow. Relevant code is: ' Needs Tools/References/Microsoft Internet Controls Public ie As SHDocVw.InternetExplorer Private killtime As Date Private Const killduration As String = &quot;00:00:30&quot; .... Private Sub kill_ie() Debug.Print now &amp; &quot; kill_ie() called&quot; killtime = 0 Set ie = Nothing End Sub Public Function Wait4IEretry(ByVal operation As String) As Boolean .... On Error GoTo newie .... killtime = now + TimeValue(killduration) Application.OnTime EarliestTime:=killtime, Procedu=&quot;kill_ie&quot;, Schedule:=True Wait4IE operation Application.OnTime EarliestTime:=killtime, Procedu=&quot;kill_ie&quot;, Schedule:=False If False Then newie: If killtime &lt;&gt; 0 Then On Error Resume Next ' ontime may not be set Application.OnTime EarliestTime:=killtime, Procedu=&quot;kill_ie&quot;, Schedule:=False End If Set ie = Nothing Resume retry Stop retry: ' Stop Wait4IEretry = False Exit Function End If .... Wait4IEretry = True Exit Function ..... End Function So Wait4IEretry starts a 3o second watchdog timer on Wait4IE completing in 30 seconds. If 30 seconds elapses, kill_ie is called and ie is made nothing, causing Wait4IE to complete with an error and transfer control to label newie. I find &quot;On Error Resume Next&quot; ineffective against errors in Application.OnTime. I zero killtime in kill_ie so Application.OnTime is not called. If I hit escape to allow me to save my XL file, Application.OnTime is called and errors. Why is &quot;On Error Resume Next&quot; ineffective? If 30 seconds does not elapse, the timer is cancelled without problem. I can't work out how to make killduration a date. In the immediate debug window, I see ?#00:00:30# 00:00:30 ?timevalue(&quot;00:00:30&quot;) 00:00:30 In the debug code window, Private Const killduration As Date = #00:00:30# is transformed into Private Const killduration As Date = #12:00:30 AM# As an sside, many cells in my worksheet have a small triangle marking their upper left corner. I remember that as meaning there is some strangeness about the data in the marked cells. I just can't work out how to Google it. excel cell warning message is ineffective. excel cell triangle corner suggests a formula error and that a trace error button should appear - it does not - the cells contain values. Unsetting Tools/Options/Error checking/Number stored as text causes those triangles to vanish and I now know what the issue is. How to I get &quot;Number stored as text&quot; to appear as a warning? -- Walter Briscoe
Ta từng nghĩ mình l* thiên hạ vô song, bao năm lăn lội chốn giang hồ, công phu phun gió phóng bão tưởng chừng không tìm ra đối thủ. Thế m* th*t không ngờ, mới rữa tay gác kiếm chưa lâu thì chốn giang hồ kia lại d*y lên bao tay cao thủ, miệng dẽo mỏ d*i lưỡi loe loa, quả l* ghê gớm thay!. Đỉnh Côn Lôn chót vót phủ mây kia tưởng rằng l* cao nhất, leo lên tới rồi mới biết ê vơ rét còn cao hơn!, ngẫm chốn giang hồ cũng th*t b* hiểm, các cao nhân dị lão như ngọa hổ t*ng long, quả th*t vê lờ, vê lờ !
  #8   Report Post  
Banned
 
Posts: 8
Default

What's Going down i am new to this, I stumbled upon this I have discovered It positively helpful and it has helped me out loads. I'm hoping to give a contribution & aid other users like its aided me. Good job.
  #9   Report Post  
Banned
 
Posts: 8
Default

I'm still learning from you, while I'm trying to reach my goals. I certainly liked reading all that is written on your blog.Keep the stories coming. I enjoyed it!
  #10   Report Post  
Banned
 
Posts: 8
Default

I'd forever want to be update on new blog posts on this internet site, saved to my bookmarks!


  #11   Report Post  
Banned
 
Posts: 8
Default

What's Taking place i'm new to this, I stumbled upon this I've found It positively useful and it has helped me out loads. I hope to contribute & help different customers like its helped me. Good job.
  #12   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 279
Default Watchdog timer issues

In message of Sat, 29 Oct 2016 17:50:33 in
microsoft.public.excel.programming, GS writes
Gary,
Thanks for your input.

Walter,

Try...

Private Const vKillET = "00:00:30"


That is effectively what I do in
Private Const killduration As String = "00:00:30"

I don't do Magyar. ;)

I feel I should be able to do
Private Const vKillET as date = sommething.


..and in your function...

killtime = TimeValue(Now) + TimeValue(vKill_ET)
'returns time in hh:mm:ss AM/PM


I do that partially with
killtime = now + TimeValue(killduration)


Why would you "cast" now?
?typename(now)
Date
?typename(timevalue(now))
Date


Also, in your function you might want to def a var to hold the boolean
value used in your If..Then block. It can be set True as a default
unless a condition toggles it false...

Dim bMyVar As Boolean
bMyVar = True '//assume success

'//some code that preserves or toggles bMyVar

If Not bMyVar Then
newie:
...


I must concede I am overloading killtime as both a value and a flag.
Slightly insanitary. ;)

How do I turn green cell north west corners into text?
--
Walter Briscoe
  #13   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 279
Default Watchdog timer issues

In message of Sat, 29 Oct 2016 17:52:09 in
microsoft.public.excel.programming, GS writes
Not sure why you're automating IE since most things it does can be
accessed directly via APIs with no wait time!


Gary, I know no better.
What APIs do you refer to?
I send a URL, await a response and analyse ie.doc.
I repeat, I know no better. ;)
--
Walter Briscoe
  #14   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,182
Default Watchdog timer issues

In message of Sat, 29 Oct 2016 17:52:09
in microsoft.public.excel.programming, GS writes
Not sure why you're automating IE since most things it does can be
accessed directly via APIs with no wait time!


Gary, I know no better.
What APIs do you refer to?
I send a URL, await a response and analyse ie.doc.
I repeat, I know no better. ;)


Have a look at my replies to the post by Robert Baer in this forum on
May 26th to see if it applies to what you are trying to do...

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion
  #15   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,182
Default Watchdog timer issues

In message of Sat, 29 Oct 2016
17:52:09 in microsoft.public.excel.programming, GS
writes
Not sure why you're automating IE since most things it does can be
accessed directly via APIs with no wait time!


Gary, I know no better.
What APIs do you refer to?
I send a URL, await a response and analyse ie.doc.
I repeat, I know no better. ;)


Have a look at my replies to the post by Robert Baer in this forum on
May 26th to see if it applies to what you are trying to do...


Subject of his post is...

"Read (and parse) file on the web"

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion


  #16   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 279
Default Watchdog timer issues

In message of Sun, 30 Oct 2016 17:36:45 in
microsoft.public.excel.programming, GS writes
In message of Sat, 29 Oct 2016
17:52:09 in microsoft.public.excel.programming, GS
writes
Not sure why you're automating IE since most things it does can be
accessed directly via APIs with no wait time!


Gary, I know no better.
What APIs do you refer to?
I send a URL, await a response and analyse ie.doc.
I repeat, I know no better. ;)


Have a look at my replies to the post by Robert Baer in this forum on
May 26th to see if it applies to what you are trying to do...


Subject of his post is...

"Read (and parse) file on the web"


Thanks!
I had a look at your contributions to this 92 member thread.
I saw 2 interesting "names": URLDownloadToFile and fParseWebPages.frm.
I googled URLDownloadToFile.
I adapted a web example. (I later found an example from Auric in the
thread.)
When I opened the downloaded page in IE, it looked different - simpler.
I made another example, which downloaded to memory. The download was
about 120k, compared with 110k.
I converted that example to write to a file. The file was similarly
simpler.
I would like an API technique to convert the downloaded HTML to DOM.
I have a reliable - but slow - method for analysing DOM information.
While Googling, I learned Regular Expressions are not recommended for
HTML analysis.

I also grabbed ParseWebPages.zip from https://www.nsncenter.com/NSN/.
When I ran the code, I got "Method or data member not found" referring
to webbrowser in

Private Sub Worksheet_Change(ByVal Target As Range)
If Target = Range("PgNum") Then
Range("WebAddr") = gsUrl1 & Target.Value: Me.WebBrowser1.Navigate
Range("WebAddr"): SetBtnState
End If
End Sub

I found no "Me" definition.

My understanding is zilch, but I am happy to learn.

OOPS! I nearly forgot to quote my example code:

Public Declare Function URLDownloadToFile Lib "urlmon" Alias
"URLDownloadToFileA" _
(ByVal pCaller As Long, ByVal szURL As String, ByVal szFileName As
String, ByVal dwReserved As Long, _
ByVal lpfnCB As Long) As Long

Private Function GetWebPage(ByRef URL As String) As String
Dim xml As Object ' need reference to get IXMLHTTPRequest
On Error Resume Next
Set xml = CreateObject("Microsoft.XMLHTTP")
With xml
.Open "GET", URL, False
.send
GetWebPage = .responseText
End With
Set xml = Nothing ' Is this needed?
End Function

Public Function DownloadFile1() As String
Dim lngRetVal As Long
Dim hFile As Long
Dim localFilename As String
Dim strCurrentURL As String
Dim content As String

localFilename = "C:\Users\IBM\AppData\Roaming\Microsoft\Excel\Down lo
ad.htm"
strCurrentURL = "https://tfl.gov.uk/bus/stop/490000235Z/new-oxford-
street?"
If True Then
content = GetWebPage(strCurrentURL)
hFile = FreeFile
Open localFilename For Output As #hFile
Write #hFile, content
Close #hFile
Else
lngRetVal = URLDownloadToFile(0, strCurrentURL, localFilename, 0, 0)
End If
hFile = FreeFile
Open localFilename For Input As #hFile
DownloadFile1 = Input$(LOF(hFile), hFile)
Close #hFile
End Function

Public Function DownloadFile0() As String
Dim lngRetVal As Long
Dim hFile As Long
Dim localFilename As String
Dim strCurrentURL As String

localFilename = "C:\Users\IBM\AppData\Roaming\Microsoft\Excel\Down lo
ad.htm"
strCurrentURL = "https://tfl.gov.uk/bus/stop/490000235Z/new-oxford-
street?"
lngRetVal = URLDownloadToFile(0, strCurrentURL, localFilename, 0, 0)
hFile = FreeFile
Open localFilename For Input As #hFile
DownloadFile = Input$(LOF(hFile), hFile)
Close #hFile
End Function

--
Walter Briscoe
  #17   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,182
Default Watchdog timer issues

The latest version of ParseWebPages.xls doesn't contain any userforms.
You can download it's zip here...

https://app.box.com/s/23yqum8auvzx17h04u4f

...and review what it does and how it works. Let me know if you need
further assistance...

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion
  #18   Report Post  
Junior Member
 
Posts: 1
Default

Quote:
Originally Posted by Walter Briscoe View Post
I am using XL 2003. I have a need to run Internet Explorer for about 20k URLs. This is beyond the capacity of IE on my system. I use a 30 second watchdog timer to detect IE becoming unreasonably slow. Relevant code is: ' Needs Tools/References/Microsoft Internet Controls Public ie As SHDocVw.InternetExplorer Private killtime As Date Private Const killduration As String = &quot;00:00:30&quot; .... Private Sub kill_ie() Debug.Print now &amp; &quot; kill_ie() called&quot; killtime = 0 Set ie = Nothing End Sub Public Function Wait4IEretry(ByVal operation As String) As Boolean .... On Error GoTo newie .... killtime = now + TimeValue(killduration) Application.OnTime EarliestTime:=killtime, Procedu=&quot;kill_ie&quot;, Schedule:=True Wait4IE operation Application.OnTime EarliestTime:=killtime, Procedu=&quot;kill_ie&quot;, Schedule:=False If False Then newie: If killtime &lt;&gt; 0 Then On Error Resume Next ' ontime may not be set Application.OnTime EarliestTime:=killtime, Procedu=&quot;kill_ie&quot;, Schedule:=False End If Set ie = Nothing Resume retry Stop retry: ' Stop Wait4IEretry = False Exit Function End If .... Wait4IEretry = True Exit Function ..... End Function So Wait4IEretry starts a 3o second watchdog timer on Wait4IE completing in 30 seconds. If 30 seconds elapses, kill_ie is called and ie is made nothing, causing Wait4IE to complete with an error and transfer control to label newie. I find &quot;On Error Resume Next&quot; ineffective against errors in Application.OnTime. I zero killtime in kill_ie so Application.OnTime is not called. If I hit escape to allow me to save my XL file, Application.OnTime is called and errors. Why is &quot;On Error Resume Next&quot; ineffective? If 30 seconds does not elapse, the timer is cancelled without problem. I can't work out how to make killduration a date. In the immediate debug window, I see ?#00:00:30# 00:00:30 ?timevalue(&quot;00:00:30&quot;) 00:00:30 In the debug code window, Private Const killduration As Date = #00:00:30# is transformed into Private Const killduration As Date = #12:00:30 AM# As an sside, many cells in my worksheet have a small triangle marking their upper left corner. I remember that as meaning there is some strangeness about the data in the marked cells. I just can't work out how to Google it. excel cell warning message is ineffective. excel cell triangle corner suggests a formula error and that a trace error button should appear - it does not - the cells contain values. Unsetting Tools/Options/Error checking/Number stored as text causes those triangles to vanish and I now know what the issue is. How to I get &quot;Number stored as text&quot; to appear as a warning? -- Walter Briscoe
Doc Chi Tiet Tai: http://4banh.info/ford-explorer-xe-7...-tai-viet-nam/

Xem Them Cac Bai Viet Khac Chua Chung Toi Tai: http://4banh.info/
  #19   Report Post  
Junior Member
 
Posts: 3
Default

Chúc mọi điều may mắn
  #20   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Watchdog timer issues

On 02/11/16 17:30, GS wrote:
The latest version of ParseWebPages.xls doesn't contain any userforms.
You can download it's zip here...



This one of the projects that my directions would be "If I wanted to get
there, I wouldn't start from here".

Use Pup.

http://www.compciv.org/recipes/cli/p...-parsing-html/
https://github.com/EricChiang/pup

Works in Windows and in everything else.

--
Adrian C


  #21   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,182
Default Watchdog timer issues

On 02/11/16 17:30, GS wrote:
The latest version of ParseWebPages.xls doesn't contain any
userforms.
You can download it's zip here...



This one of the projects that my directions would be "If I wanted to
get there, I wouldn't start from here".

Use Pup.

http://www.compciv.org/recipes/cli/p...-parsing-html/
https://github.com/EricChiang/pup

Works in Windows and in everything else.


Very nice tool! Not sure the usefullness importing the data into Excel
is from a command window without additional arduous coding. Do you have
any suggestions for Walter?

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion
  #22   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Watchdog timer issues

On 03/11/16 19:33, GS wrote:
On 02/11/16 17:30, GS wrote:
The latest version of ParseWebPages.xls doesn't contain any userforms.
You can download it's zip here...



This one of the projects that my directions would be "If I wanted to
get there, I wouldn't start from here".

Use Pup.

http://www.compciv.org/recipes/cli/p...-parsing-html/
https://github.com/EricChiang/pup

Works in Windows and in everything else.


Very nice tool! Not sure the usefullness importing the data into Excel
is from a command window without additional arduous coding. Do you have
any suggestions for Walter?


Well, for one it would enable dropping the nasty internet controls stuff
from Excel, and CLI results can be got at through WScript.Shell


http://stackoverflow.com/questions/1...sing-excel-vba

I use pup in a bash script on linux, but the thing would be a fit here
with less overall coding.

--
Adrian C
  #23   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,182
Default Watchdog timer issues

On 03/11/16 19:33, GS wrote:
On 02/11/16 17:30, GS wrote:
The latest version of ParseWebPages.xls doesn't contain any
userforms.
You can download it's zip here...



This one of the projects that my directions would be "If I wanted
to
get there, I wouldn't start from here".

Use Pup.

http://www.compciv.org/recipes/cli/p...-parsing-html/
https://github.com/EricChiang/pup

Works in Windows and in everything else.


Very nice tool! Not sure the usefullness importing the data into
Excel
is from a command window without additional arduous coding. Do you
have
any suggestions for Walter?


Well, for one it would enable dropping the nasty internet controls
stuff from Excel, and CLI results can be got at through WScript.Shell


http://stackoverflow.com/questions/1...sing-excel-vba

I use pup in a bash script on linux, but the thing would be a fit
here with less overall coding.


Thanks!
The idea behind Excel development is to primarily use VBA for
automating tasks. Any command line can be run to execute external
programs, but further automation code is required to manipulate as
desired. Not much different than automating IE, IMO.

The sample I linked to demos using the WebBrowser as well as using pure
VB[A] so the differences are exposed; -the major one being the speed of
using an API/VB is orders of magnitude faster than automating!

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion
  #24   Report Post  
Junior Member
 
Posts: 1
Default

Chúc mọi điều may mắn
  #25   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 279
Default Watchdog timer issues

In message of Thu, 3 Nov 2016
20:11:09 in microsoft.public.excel.programming, Adrian Caspersz
writes
On 03/11/16 19:33, GS wrote:
On 02/11/16 17:30, GS wrote:
The latest version of ParseWebPages.xls doesn't contain any userforms.
You can download it's zip here...



This one of the projects that my directions would be "If I wanted to
get there, I wouldn't start from here".

Use Pup.

http://www.compciv.org/recipes/cli/p...-parsing-html/
https://github.com/EricChiang/pup

Works in Windows and in everything else.


Very nice tool! Not sure the usefullness importing the data into Excel
is from a command window without additional arduous coding. Do you have
any suggestions for Walter?


Well, for one it would enable dropping the nasty internet controls
stuff from Excel, and CLI results can be got at through WScript.Shell

http://stackoverflow.com/questions/1...-a-command-in-
command-prompt-using-excel-vba

I use pup in a bash script on linux, but the thing would be a fit here
with less overall coding.


Adrian,
Thanks!
I do not see how to port Pup to Windows (Vista Business Service Pack 2
for me).
Even if I did do so, It does not seem capable of returning a DOM
(Document Object Model).
--
Walter Briscoe


  #26   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 279
Default Watchdog timer issues

In message of Wed, 2 Nov 2016 13:30:11 in microsoft.public.excel.programming, GS
writes
The latest version of ParseWebPages.xls doesn't contain any userforms. You can download it's zip here...

https://app.box.com/s/23yqum8auvzx17h04u4f

..and review what it does and how it works. Let me know if you need further assistance...


Garry,
This is my day for admitting stupidity. I downloaded the revised
ParseWebPages.zip file and opened ParseWebPages.xls. I can't see what
it does. When I try to run AutoParse, I get "Compile Error
Can't find project or library". Format is highlighted in
"oTimer.StopTimer: Debug.Print "AutoParse took " & Format(oTimer.Elapsed, "#.000000") & " seconds.""

I am suspicious it is a problem with my own implementation.

For a while, I have not been able to run Bob Bovey's VBA Code Cleaner,
found in <http:www.appspro.com/Utilities/CodeCleaner.htm
It installs, but quietly fails to add a menu item to the VBE Tools Menu.

VBA CODE DECOMPILER AND COMPACTOR from http://orlando.mvps.org
seems to have vanished since I use it on 20160524.

I have had success with getting URLs into strings using
"Microsoft.XMLHTTP". Thousand of successful reads had a mean of about
a second and a standard deviation of about 1.5 seconds.
I Googled Microsoft.XMLHTTP and saw a reference to a responseXML member.
I can't again find something I read that it is only set for IE10 and
upwards. (I run IE9 and IE10 won't run on Vista).

I ran happily, grabbing each piece of information with a dedicated
regular expression (RE). Naughtily (I did not measure timing), I decided to
go for one RE for all pieces of information.

I ended with
Const grabpage0 As String = "^[\x00-\xFF]*([\x00-\xFF]{100}headline-info with-icon[\x00-\xFF]{500})" & _
"[\x00-\xFF]*arrival times of the next bus, text (\d{5}) to 87287[" & _
"[\x00-\xFF]*(first-last-details.*)" & _
"[\x00-\xFF]*(toId=.*)" & _
"[\x00-\xFF]*(href..*maps..*InputGeolocation=.*)[\x00-\xFF]*$"
That RE is 95%+ effective. Some data are missing from some pages.
I tried (:arrival times of the next bus, text (\d{5}) to 87287)?, but
that always returned empty - the RE engine finds it "easier" to
skip a datum than to set it, when given a choice.

The code seems to run in about 6 hours, rather than 12 when I started.
I aim to run it about once a week.
I don't have a watchdog timer on "Microsoft.XMLHTTP".
It seems less susceptible to seizing up than the IE9 browser.
--
Walter Briscoe
  #27   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,182
Default Watchdog timer issues

Garry,
This is my day for admitting stupidity. I downloaded the revised
ParseWebPages.zip file and opened ParseWebPages.xls. I can't see what
it does. When I try to run AutoParse, I get "Compile Error
Can't find project or library". Format is highlighted in
"oTimer.StopTimer: Debug.Print "AutoParse took " &
Format(oTimer.Elapsed, "#.000000") & " seconds.""


The project requires 'References' to:

Microsoft Internet Controls
Microsoft HTML Object Library


All the controls on 'Sheet1' work with WebBrowser1 and txtPgSrc.

You must 1st 'View Source' for the page rendered in the browser.
If the page is a 'parent' it contains links to items (child pages);
Click 'Get Item Links' to parse these links into txtPgSrc;

If you click a link in the browser:
Click 'View Source' to load the HTML into txtPgSrc;
Click 'Get Item Info' to load the search results into txtPgSrc;


The 'AutoParse' proc in m_OpenClose uses 'URLDownloadToFile()'. This
returns the entire web page source which, you will see if you compare,
is entirely different than the source returned for the rendered page in
the browser.


This example searches nsncenter.com for specific product info. It demos
how to parse the same info from a browser as well as directly from a
downloaded file. Some links have more than 1 product item listed, which
you'll see using the controls on 'Sheet1'. The same info is written to
an output file using the 'AutoParse' proc. Currently, this proc is
hard-coded to process 10 parent pages, each of which contain links to
11 child pages.

As of this reply both approaches are working as expected. Try closing
Excel and start over. Be careful to not just 'End' VBA when an error
occurs because this leaves objects loaded to memory; -make sure these
are set to 'Nothing'.

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion
  #28   Report Post  
Junior Member
 
Posts: 10
Default

gọi đ*p Huyen Mới Nguyen em ăn chồng phá Đang đấy. đi xong trưa :v. Tâm nay M*p chị về chỗ Gam Gọi Jessica vợ gặp Gấu cả kêu Bùi Thu Bui Nguyen
Bảo Hiểm Daiichi life
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
timer Roger on Excel Excel Programming 2 August 3rd 08 11:37 AM
timer mike allen[_2_] Excel Programming 3 March 17th 07 12:05 AM
Lap-timer kabildgaard Excel Discussion (Misc queries) 0 August 11th 06 03:26 PM
Stopping a Timer / Running a timer simultaneously on Excel Paul23 Excel Discussion (Misc queries) 1 March 10th 06 01:08 PM
need help with a timer ionaman Excel Programming 0 April 13th 04 08:40 PM


All times are GMT +1. The time now is 02:05 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright 2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"