Sort of a nice catch there Kent but the others are parameters as well and should not be declared.

I didn't even notice it. I think that is some on the fly or OLD code from Howard B. that is not a NoVarsInStrings or Explicit compliant UDF.

I was not able to find this exact UDF in the UDF forum so I assume this is/was something Howard whipped up a while back.

Howard, if you can please update your code example to be compliant with the above options.

Ozz, for now until Howard looks at his code. You can remove the $Drive, $Server, $Share from the DIM statement in the MapDrive UDF.

Then run it from a DOS console and you should be prompted by KiXtart that some vars are not declared. Add those to the DIM line where needed.