Hi,
Here is the code:
Each time I run my code and if DB.xls is open it halts the code.HTML Code:
Thanks for your help.
Jaz
Hi,
Here is the code:
Each time I run my code and if DB.xls is open it halts the code.HTML Code:
Thanks for your help.
Jaz
If the activeworkbook is DB.xls, there's no need to activaate it. Do you want to know if it's among the open workbooks?
Entia non sunt multiplicanda sine necessitate
Hello jazbath,
I am not sure if this is what you are after. This code will test if the file open is open or not. This code can also be used for testing if the file has been opened in a separate instance of Excel (Code from Microsoft article KB213383)
Please Login or Register to view this content.
Sincerely,
Leith Ross
Remember To Do the Following....
1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.2. Thank those who have helped you by clicking the Star below the post.3. Please mark your post [SOLVED] if it has been answered satisfactorily.
Old Scottish Proverb...
Luathaid gu deanamh maille! (Rushing causes delays!)
Hi Leith,
thanks for posting the code. I am not looking for something like this. I am running a code to collect data from a run sheet and put into DB.xls. So if DB.xls is already open I am trying to have the code just select DB. If not open DB.xls to input data.
Thank you
Jaz
Hello jazbath,
Will you be in Excel when you do this check for DB.xls?
Hello jazbath,
Sorry for the delay. My wife came home late and we finished dinner. This will set the object variable Wkb to the workbook "DB.xls". If the workbook isn't open then the macro will open it. This assumes "DB.xls" is in current directory. If it is located elsewhere, you need to add the folder path to the file name to open it.
Please Login or Register to view this content.
Leith,
Thank you for the code. That solved the problem.
Sincerely
Jaz
Last edited by shg; 05-25-2010 at 06:30 PM. Reason: deleted quote
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks