dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7

Thread: VBS file not able to open Internet Explorer

  1. #1
    Join Date
    Jan 2009
    Posts
    32

    VBS file not able to open Internet Explorer

    Hi,

    I am facing a few issues since an automatic update. First my Brother Scanner software started acting up. I tried a couple of times to do a system restore but it didn't work. I suspected a virus so I ran the anti-virus /malware programs recommended by majorgeeks.com - malware bytes, hitmanPro, rougekiller etc.

    Now I am noticing that my VBS files are no more able to open Internet Explorer ( I have IE11). I made sure that simple vb scripts such as Msgbox "Hello World" are working fine.

    When I run a simple script like the one below, the IE doesn't pop up. The taskmanager, however, shows that the process of Microsoft Windows Based Script Host is running.

    How do I fix this?

    Thanks.

    Code:
     On Error Resume Next
     Dim ObjIE
    
      Set ObjIE = CreateObject("InternetExplorer.Application")
    
        With ObjIE
    
        .Visible = 1
        .navigate "www.google.com"
      
         Do While .Busy: DoEvents: Loop
         Do While .readyState <> 4: DoEvents: Loop
    
      End With

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    19,195

    Re: VBS file not able to open Internet Explorer

    Did you debug your code? Did you do some error checking?
    Victor Nijegorodov

  3. #3
    Join Date
    Jan 2009
    Posts
    32

    Re: VBS file not able to open Internet Explorer

    Quote Originally Posted by VictorN View Post
    Did you debug your code? Did you do some error checking?
    No, I did not suspect any error as I have been using these scripts for a long time.

    Also, is there an editor to debug a vbs script? I usually, use my Excel VBA if a script has issues.

  4. #4
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    19,195

    Re: VBS file not able to open Internet Explorer

    Quote Originally Posted by musicgold View Post
    No, I did not suspect any error as I have been using these scripts for a long time.

    Also, is there an editor to debug a vbs script? I usually, use my Excel VBA if a script has issues.
    I used some old versions of Excel VBA a lot of years back and there was no any problem to debug...

    You could also do something like in this example: https://technet.microsoft.com/en-us/.../ee692852.aspx
    Victor Nijegorodov

  5. #5
    Join Date
    Jan 2009
    Posts
    32

    Re: VBS file not able to open Internet Explorer

    Quote Originally Posted by VictorN View Post
    Did you debug your code? Did you do some error checking?
    Okay, having removed the "On Error Resume Next" line, I am now getting the following error message:

    Activex Component can't create object: InternetExplorer. Application
    Code: 800A01AD
    Source: Microsoft VBScript runtime error


    What should I do now?

  6. #6
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    19,195

    Re: VBS file not able to open Internet Explorer

    Well, at this point I cannot help you more.
    Try to google for this error code:
    https://www.google.de/search?q=800A0...hrome&ie=UTF-8
    Victor Nijegorodov

  7. #7
    Join Date
    Jun 2009
    Posts
    103

    Re: VBS file not able to open Internet Explorer

    Your code is fine. It sounds like either something is blocking access to launch IE or IE itself has been removed. Can you open IE manually? Check your AV software to see if it's reporting any problems, and it might be worth disabling it temporarily before trying the script again. Run REGEDIT and do a search on My Computer for "InternetExplorer.Application" to see if the COM component is still registered.
    It's also worth opening a Command Prompt as Administrator and launch your VBScript again using CSCRIPT.EXE to see if it's a rights issue.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)