我正在尝试使用此代码打开一个csv文件并且它一直给我一个“错误52错误的文件名或数字”
Sub ShowFileDialog()
Dim x As String
Dim FF1 As Integer
Dim dlgOpen As FileDialog
Set dlgOpen = Application.FileDialog( _
msoFileDialogFilePicker)
With dlgOpen
.Show
End With
x = CStr(dlgOpen.SelectedItems(1))
MsgBox x
Open x For Input As #FF1
Do While Not EOF(FF1)
Line Input #FF1, inputdata
Dim lineData() As String
lineData() = Split(inputdata, ",")
Loop
Close #FF1
End Sub
调试器突出显示Open for X行,但是我将它作为字符串
提供给它