I have a VBA project in excel which hides the workbook in the background and only shows the userform, it works fine however, causes problems when other workbooks are open as it hides them also. To prevent this I am trying to find some method of placing an if statement in the code which checks if any excel workbook is open at the time of start-up. Is this possible? All I can find online is how to check this if the open file name is known.
相关问题
- Excel sunburst chart: Some labels missing
- Error handling only works once
- Error handling only works once
- Excel formula in VBA code
- Excel VBA run time error 450 from referencing a ra
相关文章
- Get column data by Column name and sheet name
- programmatically excel cells to be auto fit width
- Unregister a XLL in Excel (VBA)
- Unregister a XLL in Excel (VBA)
- How to prevent excel from truncating numbers in a
- numeric up down control in vba
- Declare a Range relative to the Active Cell with V
- What's the easiest way to create an Excel tabl
I think, since 'ActiveWorkbook' can also be empty, the safest answer for VBA may be:
The ideal solution is not to force a multitasking Excel user to close all their workbooks in order to use the one with the user form, but to specifically address the workbook in your code so that it doesn't effect other workbooks. You can use
ActiveWorkbook.FullName
for this.This may help you: