Edge Browser window keeps freezing/crashing after interacting with VBA. (1 Viewer)

wackywoo105

Registered User.
Local time
Today, 06:00
Joined
Mar 14, 2014
Messages
203
Starting today the Edge Browser window in a form has stopped working. It was fine this am. I have several versions of the code, all at different stages. I have tried them on 2 different PC. The site I'm trying to access works fine on chrome and normal edge. The Edge browser window doesn't work after doing anything other than navigating to a page. It just freezes and on some occasions the database closes and reopens with an extra file with suffix backup.

Is there a known issue affecting it ATM?
 

isladogs

MVP / VIP
Local time
Today, 14:00
Joined
Jan 14, 2017
Messages
18,225
Not that I'm aware of. Perhaps it would help if you specified the site that's causing problems
Try decompiling then compacting your app.
Also, did you run an Office update earlier today?
 

GPGeorge

Grover Park George
Local time
Today, 06:00
Joined
Nov 25, 2004
Messages
1,869
Things can go wrong, so follow Colin's suggestions and start fresh.

Also, you report " The site I'm trying to access works fine on chrome and normal edge..." Does this problem impact all sites, or just this one? Is is a problem, in other words, for that specific site itself?
 

wackywoo105

Registered User.
Local time
Today, 06:00
Joined
Mar 14, 2014
Messages
203
Looks like I can type posts again.

Thanks for your help.

I slowly transfered the code to another version of the database. What appears to be happening is the edge browser window is not updating. The code appears to be running in the background. On some occasions it will run until the end. I have a QR code and signature picture window and this updates fine as the code runs. Sometimes the code fails as I'm still trying to figure out a couple of issues. On other occasions it errors saying a particular page has failed to load (This is my own code that reads the page html to check if a page has loaded. If it takes too long it shows a failed message and exits). On some occasions the database crashes and reopens having auto saved a backup.

This was completely fine yesterday am. I ran it multiples times without issue. Then in the pm it was playing up. I've tried it on another PC and have now even slowly moved the relevant code over to a new database and it still doesn't work.

I can get it to show the login page and on some occasion to login, but anything more complex and it appears to hang.

I didn't realise the edge browser window was a fairly new addition to access. I guess this is why I originally went down the IE route, as everything I read was about that. I have now read quite a lot about various bugs and issues with the edge browser integration, so I wonder if I am suffering form something like this?

If I can't get this working I'm thinking I will have to look into Selenium. Hopefully it will be 3rd time lucky.

EDIT: This is the site: https://secure.uat.pcse.england.nhs.uk/

Can anyone recommend any resources to that can help me with this such as example databases and example code? I have a a couple but they are fairly basic.

EDIT2:

Even the database I downloaded from here is playing up: https://www.devhut.net/everything-y...-about-the-access-modern-web-browser-control/

EDIT3: I'm getting it to work in the example database. It still doesn't work in my database. Could this be some sort of error with the database?
 
Last edited:

isladogs

MVP / VIP
Local time
Today, 14:00
Joined
Jan 14, 2017
Messages
18,225
It works for me (version 2401 build 17130.20000) though I had problems about a month ago that have since been fixed.
Note my version comments in the screenshot
1701881476340.png
 

wackywoo105

Registered User.
Local time
Today, 06:00
Joined
Mar 14, 2014
Messages
203
Thanks. I pretty much had it fully working and was getting ready to transfer it across to my working database. I think I'm on ver 2311, but will check when I get back home. I'm going to get rid of any non essential code and try it again.

If I get working is it likely to be temperamental with future updates? Is the edge browser integration with access still a work in progress, or should it be relatively stable? I'm wondering if I should leave it here for now and try the Selenium route.
 

wackywoo105

Registered User.
Local time
Today, 06:00
Joined
Mar 14, 2014
Messages
203
I've stripped out everything except navigating to the site, pausing, entering details, clicking login, pausing etc. It still doesn't work. The front page shows but I cannot interact. Previously as the code was running I could move the webpage in the window and see all the data being entered and the pages loaded and updated. Now it just becomes unresponsive and freezes.

I'm on Microsoft® Access® for Microsoft 365 MSO (Version 2311 Build 16.0.17029.20028) 64-bit.

Whist coding isn't my day job, I'm not stupid and can generally figure out if I'm being thwarted by something other than my dodgy code. I'm not going to waste more time on the edge browser access integration. There is something else going on for it to have been working perfectly yesterday am and then fall over by the afternoon, when I hadn't changed anything in-between.

I assume I can transfer most of what I have produced to another method, so will research Selenium and move in that direction..
 

isladogs

MVP / VIP
Local time
Today, 14:00
Joined
Jan 14, 2017
Messages
18,225
AFAIK it’s been stable since its official release apart from a temporary glitch in recent weeks.
However if you look at my screenshot you will see you are using a version affected by that issue.
Its obviously your choice but I would personally recommend waiting till the next update or move to an Insider Channel to get the fix

Obviously, I can't test the site in the Edge browser as I don't have authorisation to login

I have no experience with Selenium so cannot advise on its use
 

wackywoo105

Registered User.
Local time
Today, 06:00
Joined
Mar 14, 2014
Messages
203
AFAIK it’s been stable since its official release apart from a temporary glitch in recent weeks.
However if you look at my screenshot you will see you are using a version affected by that issue.
Its obviously your choice but I would personally recommend waiting till the next update or move to an Insider Channel to get the fix

Obviously, I can't test the site in the Edge browser as I don't have authorisation to login

I have no experience with Selenium so cannot advise on its use

I'm happy to PM you the login as it's a test site. I just don't think I should post it publicly. Would be willing to test it for me? If so I would be very grateful.

Is it really possible that an update that happened without my knowledge killed it? I have had previous issues that have been caused and fixed by updates.
 

isladogs

MVP / VIP
Local time
Today, 14:00
Joined
Jan 14, 2017
Messages
18,225
Sure. PM me or email me using the link in my signature line. It probably won't be until tomorrow evening though
 

wackywoo105

Registered User.
Local time
Today, 06:00
Joined
Mar 14, 2014
Messages
203
No worries and many thanks.

Here is sample of the code that was working fine. I've added a pause function instead of all the x= timer + 2 stuff, but this is since the code keeled over so will stick to what was working.

If I run this the browser window freezes up.

Also how do I get updates sooner? Access says it's up to date but there is an option to join the insider program? Do I need to do this?

Code:
Dim Login As String
Dim Password As String
Login = "xxxxxx"
Password = "xxxxxx"
Dim PageScale As Variant: PageScale = 0.85
Dim TimeOut As Integer: TimeOut = 20

Me.EdgeBrowser0.Visible = True
Me.EdgeBrowser0.Navigate "https://secure.uat.pcse.england.nhs.uk/"
Do While Me.EdgeBrowser0.ReadyState <> 4
    DoEvents
Loop
y = Timer + TimeOut
FromStartAgain:
If Not Me.EdgeBrowser0.RetrieveJavascriptValue("document.documentElement.innerHTML") Like "*" & "Forgotten your login details?" & "*" Then
    x = Timer + 2
    Do While Timer < x
        DoEvents
    Loop
    If Timer > y Then
        MsgBox "Page failed to load in time."
        Exit Sub
    End If
    DoEvents
    GoTo FromStartAgain
End If
'Loop
Me.EdgeBrowser0.ExecuteJavascript ("document.body.style.transform='scale(" & PageScale & ")';")

Me.EdgeBrowser0.ExecuteJavascript "document.getElementById('PlaceHolderMain_signInControl_UserName').value =" & Chr(34) & Login & Chr(34) & ";"
Me.EdgeBrowser0.ExecuteJavascript "document.getElementById('PlaceHolderMain_signInControl_password').value =" & Chr(34) & Password & Chr(34) & ";"
Me.EdgeBrowser0.ExecuteJavascript "document.getElementById('PlaceHolderMain_signInControl_login').click();"


y = Timer + TimeOut
FromStartAgain2:
If Not Me.EdgeBrowser0.RetrieveJavascriptValue("document.documentElement.innerHTML") Like "*" & "Track claims, view statements and easily reconcile your payments." & "*" Then
    x = Timer + 2
    Do While Timer < x
        DoEvents
    Loop
    If Timer > y Then
        MsgBox "Page failed to load in time."
        Exit Sub
    End If
    DoEvents
    GoTo FromStartAgain2
End If
'Loop
Me.EdgeBrowser0.ExecuteJavascript ("document.body.style.transform='scale(" & PageScale & ")';")

Me.EdgeBrowser0.Navigate "https://secure.uat.pcse.england.nhs.uk/OPH/OphthalmicGosFour/GOSFour"


Do While Me.EdgeBrowser0.ReadyState <> 4
    DoEvents
Loop
y = Timer + TimeOut
'Do Until InStr(1, Me.EdgeBrowser0.RetrieveJavascriptValue("document.documentElement.innerHTML"), "Search for your residential address by entering your postcode") > 0
PatientDetailsNotLoaded:
If Not Me.EdgeBrowser0.RetrieveJavascriptValue("document.documentElement.innerHTML") Like "*" & "Search for your residential address by entering your postcode" & "*" Then
    x = Timer + 5
    Do While Timer < x
        DoEvents
    Loop
    If Timer > y Then
        MsgBox "Page failed to load in time."
        Exit Sub
    End If
    DoEvents
    GoTo PatientDetailsNotLoaded
End If
'Loop
Me.EdgeBrowser0.ExecuteJavascript ("document.body.style.transform='scale(" & PageScale & ")';")

Me.EdgeBrowser0.ExecuteJavascript "document.getElementById('titleCode').selectedIndex = 1;"
Me.EdgeBrowser0.ExecuteJavascript "document.getElementById('FirstName').value =" & Chr(34) & "Harry" & Chr(34) & ";"
Me.EdgeBrowser0.ExecuteJavascript "document.getElementById('Surname').value =" & Chr(34) & "Barry" & Chr(34) & ";"
Me.EdgeBrowser0.ExecuteJavascript "document.getElementById('txtDateOfBirth').value =" & Chr(34) & Format("01/01/1999", "dd/mm/yyyy") & Chr(34)
 
Last edited:

isladogs

MVP / VIP
Local time
Today, 14:00
Joined
Jan 14, 2017
Messages
18,225
Can you zip and email me a cut down version of the app with all the relevant code rather than a sample.
If you don't want to wait, you will have to opt in to the insiders channel to get those updates. I'm on Beta but Current Channel Preview is safer
 

wackywoo105

Registered User.
Local time
Today, 06:00
Joined
Mar 14, 2014
Messages
203
Can you zip and email me a cut down version of the app with all the relevant code rather than a sample.
If you don't want to wait, you will have to opt in to the insiders channel to get those updates. I'm on Beta but Current Channel Preview is safer
Thanks. I tried to produce a cut down version but it is proving difficult. It will be easier if I just code up a "working" version in separate database. I have put this on the back burner as I'm hoping when office updates the issue will resolve.

Is there anywhere I can find out when I will be upgraded to 2312?

On another note does anyone know why VBA code would completely vanish from and excel xlsm file? It happen once a few months ago at home and I thought maybe I did something. Yesterday it happened again to different file on a work computer. All VBA code gone and it was password protected. File is still xlsm and hasn't been saved in any different format. Another issue with 2311? I searched online and can find many people experiencing the same but no reason or solution. It's a good job I back stuff up.

I appreciate this is probably the wrong forum, so will post elsewhere if nobody can help.
 

isladogs

MVP / VIP
Local time
Today, 14:00
Joined
Jan 14, 2017
Messages
18,225
Is there anywhere I can find out when I will be upgraded to 2312?
Probably the last week of December if you stay in the Current Channel.

Hopefully you saw my detailed reply in the private conversation
 

wackywoo105

Registered User.
Local time
Today, 06:00
Joined
Mar 14, 2014
Messages
203
Probably the last week of December if you stay in the Current Channel.

Hopefully you saw my detailed reply in the private conversation
Hi,

I've sent across a test database. I hope it function correctly.

Many thanks
Andy
 

wackywoo105

Registered User.
Local time
Today, 06:00
Joined
Mar 14, 2014
Messages
203
Today Access updated to Microsoft® Access® for Microsoft 365 MSO (Version 2312 Build 16.0.17126.20078) 64-bit

The good new is the Edge browser window now appears fluid and responsive.

The bad new is the password to the test account I was using has expired and they are dragging their heels with sending me a new one.
 

vxr

New member
Local time
Today, 09:00
Joined
Jul 11, 2023
Messages
17
Hello All. I am on version 2312 Build 17126.20132. Edge browser still not working. It works only on one PC that I have downgraded to an older version. According to this thread, it should be resolved, no? Thanks
 

wackywoo105

Registered User.
Local time
Today, 06:00
Joined
Mar 14, 2014
Messages
203
Hello All. I am on version 2312 Build 17126.20132. Edge browser still not working. It works only on one PC that I have downgraded to an older version. According to this thread, it should be resolved, no? Thanks
I'm running Microsoft® Access® for Microsoft 365 MSO (Version 2312 Build 16.0.17126.20132) 64-bit now and Edge browser is working fine.
 

Users who are viewing this thread

Top Bottom