[AccessD] Closing edge browser
Stuart McLachlan
stuart at lexacorp.com.pg
Mon Apr 10 01:27:22 CDT 2023
I doubt it since Shell.ShellExecute doesn't return a handle to the shelled application.
However, if you use the VBA Shell function instead, it returns the ProcessID of the shelled
application, so you can subsequently close that process with TaskKill.
Example here:
https://wellsr.com/vba/2015/tutorials/open-and-close-file-with-VBA-Shell/
On 10 Apr 2023 at 1:13, John Colby wrote:
> I have code which opens Edge and feeds it a google map. Given that
> objShell opens Edge, does it point to the browser, IOW can I then
> somehow close the browser when I am done with it using objShell?
>
> Dim strGoogleMapAddr As String
> Dim objShell As Object
>
>
> strGoogleMapAddr = strMSEdge & strMDIAddr & "/" & strMapAddr &
> strMDIAddr
> 'Debug.Print strGoogleMapAddr
> Set objShell = CreateObject("Shell.Application")
> objShell.ShellExecute strGoogleMapAddr
>
>
> --
> John W. Colby
> Colby Consulting
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> https://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>
More information about the AccessD
mailing list