将带分隔符txt文件另存为xls格式
'功能:批量另存为一个目录下的XLS文件
'srcPath 源目录
'desPath 目标目录
'---------------------------------------
Sub SaveAsExcelInPath(srcPath As String, desPath As String)
If Right(srcPath, 1) <> "/" Then
srcPath = srcPath + "/"
End If
If Right(desPath, 1) <> "/" Then
desPath = desPath + "/"
End If
ChDir srcPath
Dim f_name$
f_name = Dir(srcPath + "*.xls")
While f_name <> ""
SaveAsExcel srcPath, desPath, f_name
f_name = Dir()
Wend
End Sub
'---------------------------------------
'功能:另存为一个XLS文件
'srcPath 源目录
'desPath 目标目录
'FileName 文件名
'---------------------------------