Code: Select all
numBks = xlApp.Workbooks.Count
Would that be because the .Count is the count of ALL workbooks so it's counting personal.xls or some other hidden workbook?
Ken
Code: Select all
numBks = xlApp.Workbooks.Count
Code: Select all
Function CountVisible() As Boolean
Dim lCt As Long
Dim oWb As Workbook
For Each oWb in Workbooks
If oWb.Windows(1).Visible = True Then
lCt = lCt + 1
End If
Next
CountVisible = lCt
End Function