Dim s
With Application.FileSearch '查找
.LookIn = Path '范围为此目录下"
.Filename = "*.xls"
.Execute msoSortByFileName '执行查找过程,并且将查询结果按文件名排序
For Each s In .FoundFiles
Private Sub Command0_Click()
Path = InputBox("输入打印路径")
Set xlapp = CreateObject("Excel.Application")
Dim s
With Application.FileSearch '查找
.LookIn = Path '范围为此目录下"
.Filename = "*.xls"
.Execute msoSortByFileName '执行查找过程,并且将查询结果按文件名排序
For Each s In .FoundFiles
Set wb = xlapp.workbooks.Open(s, , True)
wb.xlapp.Sheets("Income Rec'd-note 6").Select