Hi again... I know how to check to see if the workbook exists and I found a routine to check to see if the workbook is currently open but instead of exiting the sub early, I would like to allow the user to either have the opportunity to close the open workbook prior to proceeding or even better by making use of the open workbook if it is indeed open.
I currently use the set wb1 & wb2 to open specific workbooks if they exist and are not open... can I use error handling to set an already open workbook and continue with my code?
Thus using:
Set wb2 = Workbooks.Open(wPath & w1stFolder & wFolder & wFileName2) 'If the workbook is not open
Set wb2 = the open workbook 'If workbook is already open... not sure how that would be coded!
I have been bad at using error handling but decided that I should start... I always try to code to cover all situations but I now realize that if other users are using, they will find new ways of creating errors. You can't cover everything and if you try... you will have a lot of extra un-necessary code (which is what I have now!)
Thanks
Craig
![]()
Please Login or Register to view this content.
Bookmarks