Sub test()
thesentence = InputBox("Type the filename with full extension", "Raw Data File")
Range("A1").Value = thesentence
If Dir("thesentence") <> "" Then
MsgBox "File exists."
Else
MsgBox "File doesn't exist."
End If
End Sub
在这种情况下,当我从输入框中提取文本值时,它不起作用。但是,如果"the sentence"从If中删除Dir()并将其替换为代码中的实际名称,则它可以工作。有人可以帮忙吗?
largeQ
料青山看我应如是