Ibn 'Umar (May Allah be pleased with them) said:
The Prophet (ﷺ) said, "Allah has prohibited you from taking an oath by your fathers. He who must take an oath, may do so by swearing in the Name of Allah or he should remain silent."[Al-Bukhari and Muslim].
App reference: Book 18, Hadith 197
Arabic/English book reference: Book 18, Hadith 1707