以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  关于读取EXCEL遇到的问题  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=185014)

--  作者:ygg8310
--  发布时间:2023/1/30 18:25:00
--  关于读取EXCEL遇到的问题
求助,在(待读取)文件夹中有多个子文件夹,每个子文件夹里都有excel这种情况用帮助文件的For Each file As String In filesys.GetFiles("E:\\测试"),读取不了该如何修改?


--  作者:有点蓝
--  发布时间:2023/1/30 20:11:00
--  
For Each file As String In filesys.GetFiles("E:\\测试")
文件的处理
next
For Each dir As String In filesys.GetDirectories("E:\\测试")
    For Each file As String In filesys.GetFiles(dir)
    子文件夹文件的处理
    next
next

--  作者:ygg8310
--  发布时间:2023/1/31 15:27:00
--  
老师,还有一个问题有子文件夹A中还有子文件夹B,子文件夹B中还有子文件夹C这个还是要麻烦一下老师
--  作者:有点蓝
--  发布时间:2023/1/31 15:32:00
--  
使用递归:http://www.foxtable.com/webhelp/topics/2416.htm

添加函数a

dim dir as string = args(0)
For Each file As String In filesys.GetFiles(dir)
文件的处理
next
For Each dir1 As String In filesys.GetDirectories(dir )
    Functions.Execute("a",dir1)
next

外部调用:
For Each file As String In filesys.GetFiles("E:\\测试")
文件的处理
next
For Each dir As String In filesys.GetDirectories("E:\\测试")
    Functions.Execute("a",dir)
next