If Excel 64Bits is used the following needs to be done : Private Declare Function -> Private Declare PtrSafe Function ByRef lpWideCharStr As Long -> ByRef lpWideCharStr As LongPtr