control on a user form to choose a worksheet

  • Thread starter Thread starter dovrox
  • Start date Start date
D

dovrox

In a user form - I need to place a control that lists all of the xl
files in a folder so that I can select one file to get informatio
from.

What kind of a control is it and can I see if the xls file is currentl
open by anyone else on the network
 
The control to use would be a list box or combo box populated by loopin
through the file names in the required directory. You could also us
the open dialogue.

You can check if an excel file is open with:

Private Function WorkbookIsOpen(wbname) as Boolean
'Returns TRUE if the workbook is open
Dim x As Workbook
On Error Resume Next
Set x = Workbooks(wbname)
If Err = 0 then WorkbookIsOpen = True _
Else WorkbookIsOpen = False
End Function

(from John Walkenbach)

Dunca
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top