Praise be to Allaah.
I asked our Shaykh ‘Abd al-Rahmaan al-Barraak about this and he replied:
The Prophet (peace and blessings of Allaah be upon him) said: “Allaah does not put your healing in that which He has forbidden to you.” Narrated by al-Bayhaqi and classed as saheeh by Ibn Hibbaan, from the hadeeth of Umm Salamah (may Allaah be pleased with her). So he should look for another remedy and in sha Allaah he will find a permissible alternative.
Looking at the issue from another angle, if an impure or intoxicating substance is used as a component in something such as medicine etc and is completely absorbed so that none of the original substance remains in such a way that it can be distinguished by colour, taste or smell, then some of the fuqaha’ said that it is permissible to use it.