谁能解释为什么这不起作用,它抛出一个错误说:
行:14 字符:1 错误:需要对象:'[字符串:“H:\VBS”]' 代码:800A01A8
Const xlDelimited = 1
Const xlNormal = -4143
Set Excel = CreateObject("Excel.Application")
Set fso = CreateObject("Scripting.FileSystemObject")
Dim Excel
dim objShell
dim objFolder
Dim fileLocation
set objShell = CreateObject("shell.application")
set objFolder = objshell.BrowseForFolder(0, "Select File Location", 1, "H:\")
set fileLocation = CStr(objFolder.self.path)
Set Excel = CreateObject("Excel.Application")
Set fso = CreateObject("Scripting.FileSystemObject")
folderDestination = InputBox("Enter Move to folder")
For Each f In fso.GetFolder(fileLocation).Files
If LCase(fso.GetExtensionName(f)) = "csv" Then
.Workbooks.Open
.Sheets(1).Columns("A").TextToColumns .Range("A1"), xlDelimited,,,,,,,True,"|"
.ActiveWorkbook.SaveAs .ActiveWorkbook.Path & "\1.xls", xlNormal
.Quit
End If
Next
至少可以说很困惑:S 再次非常感谢任何帮助!