Convert Shared folder path to UNC path

后端 未结 2 1664
名媛妹妹
名媛妹妹 2021-01-07 01:35

I\'m trying to convert current shared folder path to unc path by manipulating current path with computer name. However result in compile error: expected array on the line\"e

2条回答
  •  广开言路
    2021-01-07 02:20

    I'm surprised that this line doesn't throw a Mismatch error:

    CurrentPathA = Split(CurrentPath, "\")
    

    The Split function converts a string to an array. So, attempting to assign the result of Split to a string variable should raise an error.

    In any case, the Ubound function requires an array. Thus, the error when you're doing Ubound(_string_) instead of UBound(_array_).

    Dim CurrentPathA As Variant

提交回复
热议问题