My last question, "Open Excel file using VB" received an EXCELLENT answer from NicholasUK. Thank you, NicholasUK.
Continuing, I would like to know how to make sure that only one instance of Excel is open when the command button to open the new Excel file is clicked. OK, this is confusing.
Let me try this: I have a VB form where the user picks one of 19 Excel files to open. The user can open one file, then toggle back to the form and open another. If they do this, I want the first one opened to be closed automatically, prompting for a save, etc.
I can use
myExcel.workbooks("myfile.xls".close
but the problem is that I can't give the name of the open file, since it could be any one of the 19 choices.
Thanks for your help.
Mike Kemp
kempmike65@aol.com [sig][/sig]
Continuing, I would like to know how to make sure that only one instance of Excel is open when the command button to open the new Excel file is clicked. OK, this is confusing.
Let me try this: I have a VB form where the user picks one of 19 Excel files to open. The user can open one file, then toggle back to the form and open another. If they do this, I want the first one opened to be closed automatically, prompting for a save, etc.
I can use
myExcel.workbooks("myfile.xls".close
but the problem is that I can't give the name of the open file, since it could be any one of the 19 choices.
Thanks for your help.
Mike Kemp
kempmike65@aol.com [sig][/sig]