I have a VBA program in Windows that uses declared functions to retrieve which files are open, as shown in the taskbar at the bottom of my screen, next to the Start button. I would like the VB equivalent of that task bar, so that code has knowledge of all open processes.
Declared functions are a hassle to maintain; and, as I migrate my VBA code to VB.Net, some of these stop working. I won't bother reproducing the code block here, because I want to get away from the use of declared functions and subroutines, in general, and replace them with industry-standard VB routines. In general, a declared function looks as follows; and these are buggy, have little recourse for debugging, and don't migrate easily from VBA/VB6 to VB.Net:
Private Declare Function <FuncName> Lib "<Libname>" Alias "<AliasName>" ()
The point of the exercise is to determine whether an existing Word or Excel file is already open or not. Based on the status of what is already open, I can take one of the three options:
1) Open a new Excel or Word application object and then open the desired file there.
2) Note that an Excel or Word application is open, and open the desired file from that application., or
3) Note that the Excel or Word file is already open, and simply return a pointer to that existing file.
The advantage of having a system such as this is that I would never run into the problem of opening the same document two or more times, using different instances of the same Excel or Word application. If I do this, I run the risk of not knowing which version is the state of the art and which version to save and which to toss away. Knowing what app;lications are open from the start would give me the knowledge base to choose the right course programmatically.
Thanks, in advance, for your assistance. ~ Peter Ferber