回答
你有引号
什么代码基本上是试图做的是检查相关文件,目录或文件夹之间存在的不必要的空间。看看这个例子,它检查文件是否存在。
Option Explicit
Sub Sample()
Dim sPath As String
sPath = "C:\Temp\MyFile.xls"
If Dir(sPath) = "" Then
MsgBox "File not found"
Else
MsgBox "File found"
End If
End Sub
更多关于DIR
here
谢谢。但是sPath =“”会做什么? – 2013-02-14 07:13:30
我猜你给的代码是更大代码的一部分。我所假设的是,如果没有找到某个特定的文件或目录,那么它将'path'变量重置为空。 – 2013-02-14 07:16:29
方面评论:我使用'folderExists =((GetAttr(parPath)和vbDirectory)= vbDirectory)'而不是... – assylias 2013-02-14 07:17:34
- 1. 在Perl中做什么=〜做什么?
- 2. 点击从ExcelVBA
- 3. 在C++编写的ExcelVBA中使用DLL
- 4. 什么!=在玉/帕格中做什么?
- 5. 什么是opt.apply_gradients()在TensorFlow中做什么?
- 6. 什么是string.indexOf(“*。”)在Javascript中做什么?
- 7. 是什么。在Haskell中做什么?
- 8. 什么是outData.writeInt()在Java中做什么?
- 9. 什么?=在Makefile中做什么?
- 10. 什么是:%S在vim中做什么?
- 11. 什么(数组)在PHP中做什么?
- 12. 什么_,在Python中做什么
- 13. 什么 - 在ksh中做什么?
- 14. 什么是String.iter()在Rust中做什么?
- 15. “ - >”在PHP中做什么?
- 16. “last”在Perl中做什么?
- 17. '@'在c#中做什么?
- 18. @在装配中做什么?
- 19. WaitForAck在SignalR中做什么
- 20. “system(...)”在C++中做什么?
- 21. 在SceneKit中做些什么
- 22. !grep在perl中做什么?
- 23. 在C中,'''做什么?
- 24. tf.gfile在TensorFlow中做什么?
- 25. 在Ruby中做什么==?
- 26. DESC在SQL中做什么?
- 27. [[和]]在vim中做什么?
- 28. 在D3JS中cluster.size做什么?
- 29. 在java中做什么?
- 30. 在JavaScript中做什么“杀”?
一个错字的问题是如何upvoted我是无法理解。 – brettdj 2013-02-14 08:59:28