Find active Windows()

  • Thread starter Thread starter Lieven
  • Start date Start date
L

Lieven

Hi,

I would like to find out, how I can find which excelform
is open?

I would like to generate a Combobox with the active
excelfiles

I know that Windows(thexls).Activate works, but here for I
must know what the name 'thexls'

can someone help me?

thx
Lieven
 
I found already a work-around, but can't this be done
easier?

i = 1
Do While i <= Windows.Count
Windows(i).Activate
ComboBox1.AddItem (" OPEN XLS SHEET: " &
ActiveWorkbook.Name)
i = i + 1
Loop
 
Try

For Each wb In Application.Windows
ComboBox1.AddItem (" OPEN XLS SHEET: " & wb.Name)
Next wb
 
Back
Top