Returns a string representing the current path.
Public Overloads Function CurDir([ ByVal Drive As Char ]) As String
Exception type | Error number | Condition |
---|---|---|
68 | Drive is not found. | |
68 | Invalid Drive is specified. |
This example uses the CurDir function to return the current path.
' Assume current path on C drive is "C:\WINDOWS\SYSTEM". ' Assume current path on D drive is "D:\EXCEL". ' Assume C is the current drive. Dim MyPath As String MyPath =CurDir()
' Returns "C:\WINDOWS\SYSTEM". MyPath =CurDir(
"C")
' Returns "C:\WINDOWS\SYSTEM". MyPath =CurDir(
"D")
' Returns "D:\EXCEL".
ChDir Function | ChDrive Function | MkDir Function | RmDir Function |