View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
calebjill calebjill is offline
external usenet poster
 
Posts: 5
Default how to open all hidden .xls files

I have some code to open all excel files in a folder, but it will only open
the files that are not hidden. Is there a way to open all the files
regardless of hidden status.

Here is the code.

Sub open_all_files()
Dim path As Variant
Dim excelfile As Variant
path = "c:/users/caleb/documents/commissions experiment/"

excelfile = Dir(path & "*.xls")
Do While excelfile < ""
Workbooks.Open Filename:=path & excelfile
excelfile = Dir
Loop
End Sub

Thanks