Web browser control doesn't work in Access 365
-
- 5StarLounger
- Posts: 962
- Joined: 09 Feb 2010, 00:33
- Location: Patterson Lakes, Victoria, Australia
Web browser control doesn't work in Access 365
Just changed to 365, so far so good, except:
I have a form that shows a list pf PDFs. Clicking on one displays it in the web browser control in the same form. This has worked for a long time, but with 365, the PDF doesn't display in the control, instead it opens my PDF editor and appears there.
I have a form that shows a list pf PDFs. Clicking on one displays it in the web browser control in the same form. This has worked for a long time, but with 365, the PDF doesn't display in the control, instead it opens my PDF editor and appears there.
Avagr8day, regards, Peter
-
- Administrator
- Posts: 78608
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Web browser control doesn't work in Access 365
As far as I know the webbrowser control indeed doesn't work in recent versions of Office.
Best wishes,
Hans
Hans
-
- 5StarLounger
- Posts: 962
- Joined: 09 Feb 2010, 00:33
- Location: Patterson Lakes, Victoria, Australia
Re: Web browser control doesn't work in Access 365
That's progress!
It was extremely helpful being able to open the PDF in an Access form, extremely helpful.
Any ideas of a replacement technique anyone?
It was extremely helpful being able to open the PDF in an Access form, extremely helpful.
Any ideas of a replacement technique anyone?
Avagr8day, regards, Peter
-
- Lounger
- Posts: 43
- Joined: 07 Jun 2023, 15:34
Re: Web browser control doesn't work in Access 365
There seems to be a new control, Google for this keywords:
Edge-Based Browser Control Officially Released
Use the Edge browser control on a form
Access: Modern Web Browser Control
The Future of the WebBrowser control and Edge now that IE is going away
"The new Edge-based web browser control for Microsoft Access is now Generally Available for Microsoft 365 versions 2304 and later."
Edge-Based Browser Control Officially Released
Use the Edge browser control on a form
Access: Modern Web Browser Control
The Future of the WebBrowser control and Edge now that IE is going away
"The new Edge-based web browser control for Microsoft Access is now Generally Available for Microsoft 365 versions 2304 and later."
-
- 2StarLounger
- Posts: 117
- Joined: 22 Feb 2022, 09:04
Re: Web browser control doesn't work in Access 365
Lengthy post, but should provide some insight?
https://www.access-programmers.co.uk/fo ... re.326988/
Post #118 is probably a good place to start?
https://www.access-programmers.co.uk/fo ... re.326988/
Post #118 is probably a good place to start?
Using Access 2007/2019.
Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime.
Please, please use code tags when posting code snippets, click the </>icon.
Debug.Print is your lifesaver.
Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime.
Please, please use code tags when posting code snippets, click the </>icon.
Debug.Print is your lifesaver.
-
- 5StarLounger
- Posts: 962
- Joined: 09 Feb 2010, 00:33
- Location: Patterson Lakes, Victoria, Australia
Re: Web browser control doesn't work in Access 365
Wow, thanks for all that info. I used all I could find from your posts, however: the code below does nothing, not even inserting the ControlSource string into the EdgeBrowser10.ControlSource. (The old almost identical code did work and did insert the string in the old WebBrowser control.)
If I put the string from Debug.Print CtrlRef into the WebBrowser10.ControlSource and then change from design mode to Form mode, it displays the PDF as it should.
The old WebBrowser control opened almost immediately, this one takes a few seconds. But to get the functionality, I can begrudgingly live with that marvellous bit of progress.
Any ideas on how to get the ControlSource string to stick?
Code: Select all
Dim FileRef As String, CtrlRef As String
On Error GoTo Err_lstPDFs_Click
FileRef = Me![lstPDFs].Column(1) & Me![lstPDFs].Column(0)
CtrlRef = "='https://msaccess/" & FileRef & "'"
Debug.Print CtrlRef
Me.EdgeBrowser10.ControlSource = CtrlRef
Me.EdgeBrowser10.Requery
Exit_lstPDFs_Click:
Exit Sub
The old WebBrowser control opened almost immediately, this one takes a few seconds. But to get the functionality, I can begrudgingly live with that marvellous bit of progress.
Any ideas on how to get the ControlSource string to stick?
Avagr8day, regards, Peter
-
- 2StarLounger
- Posts: 117
- Joined: 22 Feb 2022, 09:04
Re: Web browser control doesn't work in Access 365
I am not convinced you would use the single quotes here?
Using Access 2007/2019.
Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime.
Please, please use code tags when posting code snippets, click the </>icon.
Debug.Print is your lifesaver.
Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime.
Please, please use code tags when posting code snippets, click the </>icon.
Debug.Print is your lifesaver.
-
- 5StarLounger
- Posts: 962
- Joined: 09 Feb 2010, 00:33
- Location: Patterson Lakes, Victoria, Australia
Re: Web browser control doesn't work in Access 365
Neither """", nor """, nor Chr(34) work either. I think I have tried all combinations.
Including with and without https://msaccess/. It did work when I pasted the string into the Property sheet in design mode without the https://msaccess/. So I guess that that isn't needed.
Including with and without https://msaccess/. It did work when I pasted the string into the Property sheet in design mode without the https://msaccess/. So I guess that that isn't needed.
Avagr8day, regards, Peter
-
- 5StarLounger
- Posts: 962
- Joined: 09 Feb 2010, 00:33
- Location: Patterson Lakes, Victoria, Australia
Re: Web browser control doesn't work in Access 365
Brainwave - with the form in Normal mode, open in Design mode, insert ControlSource from code, reopen in Normal mode. More like brain fade than brainwave: can't insert ControlSource from code in design mode.
I am desperately open to ideas on how to get the ControlSource change to actually be entered from code and stick in the EdgeBrowser10 ControlSource.
I am desperately open to ideas on how to get the ControlSource change to actually be entered from code and stick in the EdgeBrowser10 ControlSource.
Avagr8day, regards, Peter
-
- 5StarLounger
- Posts: 962
- Joined: 09 Feb 2010, 00:33
- Location: Patterson Lakes, Victoria, Australia
Re: Web browser control doesn't work in Access 365
Dumped EdgeBrowser - useless piece of MS imagination.
Tried the WebBrowser (WB) control, a bit more success.
Physically placing this line in the WB ControlSource: = [lstPDFs].[Column](1) & [lstPDFs].[Column](0), brings up the correct doc, but in my PDF editor, NOT in the WB control.
Changing the line to: ="https://msaccess/" & [lstPDFs].[Column](1) & [lstPDFs].[Column](0), only brings up the error in the WB control, 'Can’t reach this page'.
Any ideas on how to get the doc to display in the WB control?
Tried the WebBrowser (WB) control, a bit more success.
Physically placing this line in the WB ControlSource: = [lstPDFs].[Column](1) & [lstPDFs].[Column](0), brings up the correct doc, but in my PDF editor, NOT in the WB control.
Changing the line to: ="https://msaccess/" & [lstPDFs].[Column](1) & [lstPDFs].[Column](0), only brings up the error in the WB control, 'Can’t reach this page'.
Any ideas on how to get the doc to display in the WB control?
Avagr8day, regards, Peter
-
- 2StarLounger
- Posts: 117
- Joined: 22 Feb 2022, 09:04
Re: Web browser control doesn't work in Access 365
No, sorry.
Using Access 2007/2019.
Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime.
Please, please use code tags when posting code snippets, click the </>icon.
Debug.Print is your lifesaver.
Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime.
Please, please use code tags when posting code snippets, click the </>icon.
Debug.Print is your lifesaver.
-
- 2StarLounger
- Posts: 117
- Joined: 22 Feb 2022, 09:04
Re: Web browser control doesn't work in Access 365
The browser did not like spaces in the local filenames? You needed to replace with %20, I believe?
Now fixed apparently.
https://www.access-programmers.co.uk/fo ... st-1881653
Now fixed apparently.
https://www.access-programmers.co.uk/fo ... st-1881653
Using Access 2007/2019.
Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime.
Please, please use code tags when posting code snippets, click the </>icon.
Debug.Print is your lifesaver.
Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime.
Please, please use code tags when posting code snippets, click the </>icon.
Debug.Print is your lifesaver.
-
- 5StarLounger
- Posts: 962
- Joined: 09 Feb 2010, 00:33
- Location: Patterson Lakes, Victoria, Australia
Re: Web browser control doesn't work in Access 365
Oh that would be so good. But not sure what you mean. I used FileRef = Replace(FileRef, " ", "%20"), which did what it is supposed to do.
Debug.? FileRef gave E:\My%20Documents\My%20Pape.... Which is what I assume you mean. But using the EdgeBrowser control it did nothing but give an error that read.
Error Cannot find 'file//E/My%2520Documents/My%2520Paper. (It has the %20s replaced with %2520). Using the new Browser control, nothing happened.
Neither control had the control.RecordSource changed, it was still blank for both.
Debug.? FileRef gave E:\My%20Documents\My%20Pape.... Which is what I assume you mean. But using the EdgeBrowser control it did nothing but give an error that read.
Error Cannot find 'file//E/My%2520Documents/My%2520Paper. (It has the %20s replaced with %2520). Using the new Browser control, nothing happened.
Neither control had the control.RecordSource changed, it was still blank for both.
Avagr8day, regards, Peter
-
- 5StarLounger
- Posts: 962
- Joined: 09 Feb 2010, 00:33
- Location: Patterson Lakes, Victoria, Australia
Re: Web browser control doesn't work in Access 365
I did try the Adobe Acrobat Reader control. But I cannot see any way of getting a doc into it. It doesn't have a RecordSource. I will post this as a different topic.
Avagr8day, regards, Peter