IE7 RC1 and vbscript (InternetExplorer.Application)  
Author Message
Mark Coleman





PostPosted: Internet Explorer Web Development, IE7 RC1 and vbscript (InternetExplorer.Application) Top

Hi,

Has anyone had problems with existing vbscripts that output to IE and the IE7 RC1 release I have some vbscripts that use IE to display output and they work perfectly in IE6 but are broken with the RC1 release of IE7. Code like this below doesn't display anything in the browser window:

Set objExplorer = CreateObject("InternetExplorer.Application")
objExplorer.Navigate("about:blank")
objExplorer.AddressBar = 1
objExplorer.Toolbar = 1
objExplorer.StatusBar = 1
objExplorer.Width = 600
objExplorer.Height = 400
objExplorer.Left = 300
objExplorer.Top = 150

Do Until (objExplorer.readyState = 4)
wscript.sleep 100
Loop
objExplorer.Visible = 1

Set objDocument = objExplorer.Document
objDocument.Open

objDocument.Writeln "<html><head><title>Sample Title</title></head>"
objDocument.Writeln "<body><bgcolor='white'>"
objDocument.Writeln "<table width='100%'>"
objDocument.Writeln "<tr>"
objDocument.Writeln "<td width='50%'><b>Column 1 Heading</b></td>"
objDocument.Writeln "<td width='50%'><b>Column 2 Heading</b></td>"
objDocument.Writeln "<tr>"

objDocument.Writeln "<td width='50%'>Column 1 Output</td>"
objDocument.Writeln "<td width='50%'>Column 2 Output</td>"

objDocument.Writeln "</table>"
objDocument.Writeln "</body></html>"
objDocument.Write()
objDocument.Close



Internet Explorer Development8  
 
 
DSwift





PostPosted: Internet Explorer Web Development, IE7 RC1 and vbscript (InternetExplorer.Application) Top

I too am having same issue, new IE window opens, but no content:

will supply code if someone is interested to troubleshoot...

XP SP2, IE7 RC1, all patches


 
 
Mark Coleman





PostPosted: Internet Explorer Web Development, IE7 RC1 and vbscript (InternetExplorer.Application) Top

Hi,

I could never solve the problem so we ended up dumping IE7 RC1 and going back to IE6.

Mark


 
 
Tatee





PostPosted: Internet Explorer Web Development, IE7 RC1 and vbscript (InternetExplorer.Application) Top

Hi,

Unfortunately, I don't have a solution...just the same problem. A colleague thought he read that IE7 doesn't support WriteIn command, but I haven't been able to verify that.


 
 
pd.lists





PostPosted: Internet Explorer Web Development, IE7 RC1 and vbscript (InternetExplorer.Application) Top

We are seeing the same problem: our VBScript breaks when we install IE7.

Here is the error I see:

Windows Script Host
Script: C:\Documents and Settings\pdurbin\Desktop\HMDC_VNC\Libs\Connect.vbs
Line: 84
Char: 3
Error: Permission denied: 'screen'
Code: 800A0046
Source: Microsoft VBScript runtime error

And here is how to replicate the problem:

1. Install Windows XP Service Pack 2
2. Install Internet Explorer 7
(IE7-WindowsXP-x86-enu.exe version 6.2.29.0)
3. Run Double_Click_ME.bat from
http://www.hmdc.harvard.edu/HMDC_VNC.EXE

I'm looking for a solution as well.

Phil

(I also posted this at http://groups.google.com/group/microsoft.public.internetexplorer.general/browse_frm/thread/e9687148addf8e5c )

 
 
Lucidation





PostPosted: Internet Explorer Web Development, IE7 RC1 and vbscript (InternetExplorer.Application) Top

I don't know the "whys", but here's a simple way to work around the problem. In your script just add the following at the beginning:

'The following registry entry will enable local files to be displayed using IE 7.0, but this setting will not take effect if the web browser is already open (there will be no error messages displayed if this is the case).
WshShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\blank\about", 2, "REG_DWORD"

And then at the end, reset the registry key using:

' Removes the registry key setting used with IE 7.0.
WshShell.RegDelete "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\blank\"


 
 
Major





PostPosted: Internet Explorer Web Development, IE7 RC1 and vbscript (InternetExplorer.Application) Top

This solution didin't work for me. Mind you, I am not writing to a blank window, rather I am writing to a local HTML file that I load with IE then refresh regularly, This way I am displaying progress to the user but also have a log of the progress for later analysis.

In IE6 I can refresh and scroll the IE view without a problem. In IE7 I get unspecified errors.

If I rem out the refresh and just use a scroll like this: objie.document.parentwindow.scrollto 0,2000

I get the error: The object invoked has disconnected from its client.

Irritating. I don't want to have to do a major rewrite of this app....


 
 
Alex KW





PostPosted: Internet Explorer Web Development, IE7 RC1 and vbscript (InternetExplorer.Application) Top

Hello Guys, I am not a VBScript geek. I just google for the scripts I need.

My purpose here was to create an IE page without any of the toolbars (address, menu, tool) and one that refreshes after a certain time delay.

With IE 6 it worked perfectly well. I am now running an IE7 with a Windows Vista OS.

The script I used was

WshShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\blank\about", 2, "REG_DWORD"
Const clInterval = 480
Dim lMinutes : lMinutes = 0
Dim oIE
Dim bQuit : bQuit = False


Set oIE = WScript.CreateObject("InternetExplorer.Application", "oIE_")


oIE.Navigate "http://www.google.com"
'oIE.AddressBar = False
'oIE.MenuBar = False
'oIE.ToolBar = False
'oIE.Visible = True


Do Until bQuit
If lMinutes >= clInterval Then
oIE.Refresh
lMinutes = 0
End If
WScript.Sleep(1500)
lMinutes = lMinutes + 1
Loop


Sub oIE_OnQuit()
bQuit = True
End Sub

WshShell.RegDelete "HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings\ZoneMap\Domains\blank\"

I now come up with this error.

Line:1
Char:1
ErrorSurprisebject required: 'WshShell'
Code:800A01A8
Source:Microsoft VBScript runtime error

Please advise.


 
 
Major





PostPosted: Internet Explorer Web Development, IE7 RC1 and vbscript (InternetExplorer.Application) Top

From what I've been able to figure out elsewhere....

IE7 opens a new instance of itself whenever it navigates to a new page. What this means is that even though your script has created an object connection to IE7, as soon as you navigate to a new page, your object is closed and a new one is opened for the new page. You don't have a connection to this new instance. You then get the error "object required".

I haven't found a solution yet.

I have tried querying windows for IE handles I might be able to grab. Sometimes I successfully find IE7 and am able to control it, but more often than not, I find Windows Explorer instead. It was not reliable or repeatable so I had to give up.

Post a solution here if you have better luck,


Major