Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Getting an error Creating an instance of the COM component with CLSID

$
0
0

I get the following error when I run the following script, please help me find the actual reason for this error:

Creating an instance of the COM component with CLSID {0002DF01-0000-0000-C000-000000000046} from the iclassfactory failed due to the following error: 80004005

 

The script used is:

$Url="http://somewebsite.com"

$username = "aabbcc" 

$password = "rrffgg" 

$ie = New-Object -com InternetExplorer.Application 

$ie.visible=$true

$ie.navigate("$Url") 

while($ie.ReadyState -ne 4) {start-sleep -m 100} 

$ie.document.getElementById("strUserID").value= "$username" 

$ie.document.getElementById("strPassword").value = "$password" 

$ie.document.getElementById("btnLogon").Click()

start-sleep 5 

$text = $ie.Document.body.innertext | Out-String

if($text.Contains("Reports"))

{

$links = $ie.Document.getElementsByTagName('A')

$yt = $links | where {$_.innerText -eq 'Reports'}

$yt.click()

 

start-sleep 5

 

$text1 = $ie.Document.body.innertext | Out-String

if($text1.Contains("Inventory"))

{

$links = $ie.Document.getElementsByTagName('A')

$yt = $links | where {$_.innerText -eq 'Link To Crystal Reports'}

$yt.click()

}

 

Please help me out with a solution.


Viewing all articles
Browse latest Browse all 6937

Trending Articles