> ErrorCode = GetLastError ErrorCode = Err.LastDllError VBから、GetLastErrorを呼び出しても正しい値は取れません。Err.LastDllError を使ってください。