Vba getwindowtext lib3/16/2023 ![]() ![]() This code gets around the lack of hand shaking nicely. There is no way to pass a variable back using shellexicute so the PID approach won't work, unless someone knows better. I am using shellexicute to send a URL to a datamart and that process opens IE. Does anyone know how to fix this?īTY, as I was checking this out it appears the classic way to approach this is to have the process responsible for launching the IE window pass a PID back to VBA and then to use a simple API to kill that PID. I guess the do-while is not setup correctly. the testing IE will close and the other will remain open. ![]() ![]() To test this code, open 2 IE windows, use one to search for 'testing' and run the code. Underneath this code is a modifed version (of the code) that I tweaked to do the opposite, close only windows containing a user defined string. The first block of code closes all IE windows except for those containing a user defined string (the code refers to this as 'blocked' (the string 'Etreme' is blocked). I am not sure if it is ok to include a link to another forum so I'll leave it out unless someone can confirm it's ok to include. I did a little research on how to close an IE window and found a site that offers a decent solution, except it does not work 100%. ![]()
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |