Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open URL in new IE Window without Address Bar and enter Login Details

Status
Not open for further replies.

Shane_Spencer

Programmer
Apr 6, 2018
1
0
0
DE
I'm trying to write a VB Script to open the following URL:


I've got two problems. Firstly my script just opens a new Tab in an existing IE, with Address Bar etc. I'd like it to open a New Window without the AddressBar, StatusBar, ToolBar, MenuBar etc.

Secondly I'd like the two input boxes to be filled in (and better still would be to fill them in and click submit).

I've written the below code but the only bit that works is to open the URL (which will be a variable).

Code:
  set vURL = "[URL unfurl="true"]https://test-www.tax.service.gov.uk/api-test-login/sign-in?continue=%2Foauth%2Fgrantscope%3Fauth_id%3D5ac74dbb260000260070a36b&origin=oauth-frontend"[/URL]
  Set ieApp = CreateObject("Internetexplorer.Application")
    ieApp.Visible = True
    ieApp.Navigate vURL.GetContent.String
    ieApp.AddressBar = 0
    ieApp.StatusBar = 0
    ieApp.Toolbar = 0
    ieApp.MenuBar = 0
    ieApp.Height = 500
    ieApp.Width = 400
          
    With ieApp.Document
    .getElementByID("userId").value = "testing"
    .getElementByID("password").value = "testpass"
'    .getElementByID("form").submit
  End With

n.b. I'm doing this in QlikView which has a VB Script element.
 
Set objIE = CreateObject("InternetExplorer.Application")
objIE.Toolbar = False
objIE.MenuBar = False
objIE.StatusBar = False
objIE.Navigate HtmlURL

This is a fragment from something I use, it opens in a new window without the bars. I'm not sure about your usage of GetContent.String, that seems to be the difference.

Fred
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top