你是怎么导入的?估计你没有对文件名进行处理,看下面的代码: Private Sub mOpenFile(FileNames() As String, ByVal FilterString As String) Dim i As Long CommonDialog1.FileName = "" CommonDialog1.Filter = FilterString CommonDialog1.MaxFileSize = 32767 CommonDialog1.Flags = cdlOFNAllowMultiselect Or cdlOFNExplorer CommonDialog1.ShowOpen Dim buff() As String buff = Split(Me.CommonDialog1.FileName, vbNullChar) If UBound(buff) = 0 Then ReDim FileNames(0) FileNames(0) = buff(0) Else ReDim FileNames(UBound(buff) - 1) For i = 1 To UBound(buff) FileNames(i - 1) = buff(0) + "\" + buff(i) Next End If End Sub
Private Sub mOpenFile(FileNames() As String, ByVal FilterString As String)
Dim i As Long
CommonDialog1.FileName = ""
CommonDialog1.Filter = FilterString
CommonDialog1.MaxFileSize = 32767
CommonDialog1.Flags = cdlOFNAllowMultiselect Or cdlOFNExplorer
CommonDialog1.ShowOpen
Dim buff() As String
buff = Split(Me.CommonDialog1.FileName, vbNullChar)
If UBound(buff) = 0 Then
ReDim FileNames(0)
FileNames(0) = buff(0)
Else
ReDim FileNames(UBound(buff) - 1)
For i = 1 To UBound(buff)
FileNames(i - 1) = buff(0) + "\" + buff(i)
Next
End If
End Sub