stephenmbell
IS-IT--Management
I have a script that simulates a progress bar by using IE. This script works fine on IE6, but does not work on IE7 - it doesnt seem to like the document.window.location = "about:blank" (I am looking to basically clear out any text that is in the browser)
here is the script.. thank in advance for any information.
here is the script.. thank in advance for any information.
Code:
Option Explicit
Dim objIE, n
Dim objFSO, fileFound
Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists("C:\dwh\progressbar.txt") Then
fileFound = True
Else
fileFound = False
End If
Set objIE = CreateObject("internetexplorer.application")
'Here is a phony progress bar that uses an IE Window
'in code, the colon acts as a line feed
With objIE
.navigate2 "about:blank"
.width = 350
.height = 100
.toolbar = false
.menubar = false
.statusbar = false
.visible = True
End With
objIE.document.write "<font face=" & Chr(34) & "Arial" & Chr(34) &"><b>Preparing Data..</b><br>"
objIE.document.write "<font color=blue>"
Do While fileFound = True
For n = 1 to 100
If objFSO.FileExists("C:\dwh\progressbar.txt") Then
fileFound = True
objIE.document.write "|"
wscript.sleep 50
objIE.document.title = "Preparing Data..."
Else
fileFound = False
objIE.document.location = "about:blank"
objIE.document.write "<font face=" & Chr(34) & "Arial" & Chr(34) & "><b>Data Loaded!</b><br>"
Exit For
End If
Next
objIE.document.location = "about:blank"
If objFSO.FileExists("C:\dwh\progressbar.txt") Then
fileFound = True
Else
fileFound = False
End If
If fileFound = True Then
objIE.document.location = "about:blank"
objIE.document.write "<font face=" & Chr(34) & "Arial" & Chr(34) &"><b>Preparing Data..</b><br>"
objIE.document.write "<font color=blue>"
End If
Loop
objIE.quit
set objIE = nothing