Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default List all currently open xls files

Hi

I've got a form with a list box on that i want to display a list of
all excel files the user currently has open so that they can specify
one before running another procedure.

Any ideas how i should go about this?
Thanks for any suggestions
Paul
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default List all currently open xls files

Option Explicit
Private Sub CommandButton1_Click()

With Me.ListBox1
If .ListIndex < 0 Then
'nothing chosen
Beep
Else
MsgBox .Value
End If
End With

End Sub
Private Sub CommandButton2_Click()
Unload Me
End Sub
Private Sub UserForm_Initialize()

Dim wkbk As Workbook

With Me.ListBox1
For Each wkbk In Application.Workbooks
.AddItem wkbk.FullName '.name????
Next wkbk
End With

End Sub


paul wrote:

Hi

I've got a form with a list box on that i want to display a list of
all excel files the user currently has open so that they can specify
one before running another procedure.

Any ideas how i should go about this?
Thanks for any suggestions
Paul


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 25
Default List all currently open xls files

Hi Paul,

You could use the below on the UserForm_Initialize sub.

Private Sub UserForm_Initialize()

Dim xlsBook As Workbook

For Each xlsBook In Application.Workbooks
ListBox1.AddItem xlsBook.Name
Next xlsBook

End Sub

Hope this helps,

Alan

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...excel/200908/1

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Open files from List Jack Excel Discussion (Misc queries) 9 July 31st 09 08:11 PM
2007 List of Open Files? Bob Newman Excel Discussion (Misc queries) 1 November 23rd 08 09:50 PM
How to open a list of excel files and get update, then close it? Eric Excel Discussion (Misc queries) 4 June 10th 07 08:58 AM
Cannot open files in Most Recently Used List Suzan Excel Discussion (Misc queries) 3 July 29th 06 11:32 PM
create a list of worksheet names (from a single folder, or open files) Drew Excel Discussion (Misc queries) 2 April 15th 05 04:58 PM


All times are GMT +1. The time now is 04:11 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"