以下是我在网上搜到的文件移动的代码,原代码是默认为在程序所在文件内的两个文件夹内移动文件,现在我需要指定将D:\diao\ljnlp文件内的文件,移动至D:\新建文件夹\待导入数据文件夹内,我将原代码进行如下修改,提示找不到文件,请问是哪里出了错?请高手指点,谢谢!
Private Sub Command47_Click()
Dim dirname As String
Dim mypath As String
Dim mypath1 As String
mypath = "D:\diao" & "\"
dirname = Dir(mypath & "ljnlp\*" & Me.Text26 & "*.csv")
mypath1 = "D:\新建文件夹" & "\"
If dirname = "" Then GoTo Noexits
Do While dirname <> ""
Name mypath & "ljjd_jnlp\" & dirname As mypath1 & "待导入数据\" & dirname
dirname = Dir
Loop
MsgBox "文件移动完成!"
Exit Sub
Noexits:
MsgBox "找不到你输入的文件"
End Sub