【发布时间】:2012-07-19 09:49:29
【问题描述】:
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
在这种情况下,当我从输入框中提取文本值时,它不起作用。但是,如果从 If Dir() 中删除 "the sentence" 并将其替换为代码中的实际名称,则它可以工作。有人可以帮忙吗?
【问题讨论】: