473,545 Members | 1,471 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

GetObject(,"Int ernetExplorer.A pplication") unhandled exception

Trying to automate processing 80,000 data sets through 15 web pages.
Application URL creates a new IE instance in which runs first a login form
and then runs the rest of the pages in the new window.

I can connect to a running Excel instance and obtain information from the
Excel DOM. I cannot do the same with Internet Explorer. However, I can
successfully create an new IE instance and manipulate it. Using an
application that has its own VB derived scripting language I get a similar
error.

Sample VB.NET code showing ability to connect running Excel instance,
Creating an IE instance and then failing to connect to the instance is pasted
below. No try/Catch block indicates the problem is in
microsoft.visua lbasic.dll. Any ideas or work arounds? VB prefered but I am
comfortable with C# and have used many other languages.

=== Output From Code as pasted ====
Excel: Renamed Sheet1
myIE.Name = Microsoft Internet Explorer
myIEDoc.url = http://www.yahoo.com/
Exception Message: Cannot create ActiveX component.

=== Output From code with no Try/Catch block ====
Excel: Renamed Sheet1
myIE.Name = Microsoft Internet Explorer
myIEDoc.url = http://www.yahoo.com/

An unhandled exception of type 'System.Excepti on' occurred in
microsoft.visua lbasic.dll

Additional information: Cannot create ActiveX component.

=== Sample Code =====
Public Class MyExplorer
Public Shared Sub main()

' Block 1, pick up running Excel
Dim myExcel As Object
Dim myActive As Object
Dim s As String
myExcel = GetObject(, "Excel.Applicat ion")
myActive = myExcel.ActiveS heet
s = CType(myActive. Name, String)
Console.WriteLi ne("Excel: " + s)

' Block 2, Create Internet Explorer object and navigate
Dim myIE As New SHDocVw.Interne tExplorerClass
s = ""
myIE = CType(CreateObj ect("InternetEx plorer.Applicat ion"),
SHDocVw.Interne tExplorer)
myIE.Visible = True
myIE.Navigate2( "www.yahoo.com" )

While myIE.ReadyState <> SHDocVw.tagREAD YSTATE.READYSTA TE_COMPLETE
End While

s = CType(myIE.Name , String)
Console.WriteLi ne("myIE.Name = " + s)

Dim myIEDoc As mshtml.IHTMLDoc ument2
myIEDoc = CType(myIE.Docu ment, mshtml.IHTMLDoc ument2)
Console.WriteLi ne("myIEDoc.ur l = " + myIEDoc.url)

' Block 3, try to point to the running Internet Explorer
Dim myIE2 As SHDocVw.Interne tExplorerClass
s = ""
Try
myIE2 = CType(GetObject (, "InternetExplor er.Application" ),
SHDocVw.Interne tExplorer)
myIE2.Visible = True
myIE2.Navigate2 ("www.microsoft .com")

Catch ex As Exception
While True
Console.WriteLi ne("Exception Message: " + ex.Message)
Console.WriteLi ne()
If ex.InnerExcepti on Is Nothing Then
Exit While
Else
ex = ex.InnerExcepti on
End If
End While
End Try

If myIE2 Is Nothing Then Exit Sub

While myIE2.ReadyStat e <> SHDocVw.tagREAD YSTATE.READYSTA TE_COMPLETE
End While

s = CType(myIE2.Nam e, String)
Console.WriteLi ne("myIE2.Name = " + s)

Dim myIEDoc2 As mshtml.IHTMLDoc ument2
myIEDoc2 = CType(myIE.Docu ment, mshtml.IHTMLDoc ument2)
Console.WriteLi ne("myIEDoc2.ur l = " + myIEDoc2.url)

End Sub
End Class

--
Software developer/Tester
Nov 21 '05 #1
0 10117

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2053
by: Jonathan Trevor | last post by:
Hi, Spent nearly 8 hours googling and trying code on this yesterday without much success. I'd like to write a .NET application (using .NET primitives, older Win32 calls, or WMI etc) to work out which users can log onto a machine the application is running on. The platforms I'd like to support are NT/2000/XP - although 98 would be good too....
3
19134
by: Yitzhak | last post by:
I am having "Permission denied" error while calling LogEvent method of WScript.Shell component. Basically, ASP page calls Windows Script Host Shell component to log events to the OS Application Event log. My environment: Windows Server 2003, IIS 6, WSH, Classic ASP, Vbscript Below is the code and the error: Code:
8
12913
by: Hakan | last post by:
I use the following code to check if a user is an admin in the login page of our intranet. Set User = GetObject("WinNT://" & UserDomain & "/" & UserName & ",user" For Each Group in User.Group Select Case Group.Nam Case "Domain Admins Session("Admin")=Tru Case "Domain Users Session("User")=Tru End Selec
7
17863
by: Dica | last post by:
i've used the sample code from msdn to create an encyption/decryption assembly as found here: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/SecNetHT10.asp i'm able to encrypt and then decrypt data okay as in the following code: // encrypt the data // Encryptor enc = new...
0
7926
by: chaf2701 | last post by:
Hi, I was in trouble with the System.Windows.Forms.ImageList control from VC.NET. I was doing the following : 1. New Project, C#, Windows Application 2. Add ImageList component imageList1 to Form1 3. in imageList1 properties open the 'Image Collection Editor' for Images and add a simple copy.bmp
1
5403
by: Jeff | last post by:
All, I have a simple ASP web application that has been working great for years, and now we are moving to Active Directory. The following code is in my global.asa file, but is not working anymore. Note, although we have upgraded to AD, the usernames have stayed the same. Sub Session_OnStart '**Session on Start code here **...
0
2209
mmfranke
by: mmfranke | last post by:
Hello. Hi. I'm writing a logging service that uses .NET remoting. The idea is that the service publishes an EventProcessor object that clients can access via .NET Remoting, passing it DiagnosticEvent objects for processing. I've altered the main program for the service slightly so that I can run it more easily as a "regular" application...
2
4701
by: Wimpie van Lingen | last post by:
Hey I have some more questions with regards to Remoting in .NET 2. I'm using TCP with the Binary formatter. My solution consists of 4 projects: - Class Library containing the server classes which Inherits MarshalByRefObject (ok, at this stage it only contains one class... but its gonna grow) - Class Library containing common classes...
3
5523
by: wingsganesh | last post by:
Hi buddys, I have the followinf Bug......... when i run my application "NotSupportedException was un handled" in "System.Drawing.Icon" for the following designer code.... Me.picImgMain.Image = CType(resources.GetObject("picImgMain.Image"), System.Drawing.Image) can u give any idea
0
7465
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7805
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7416
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7752
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5969
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
4944
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3441
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1878
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1013
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.