The synthesis of some novel azasteroids and thiasteroids based on a pregnan nucleus with a Delta7 double bond in two to five steps from the key aldehyde (3S,20S)-20-formylpregn-7-en-3-yl acetate has been disclosed herein. These compounds were evaluated as potential inhibitors of the enzyme Delta24-sterol methyltransferase (24-SMT), which is a key enzyme in the biosynthesis of ergosterol, and for their effects on the growth of the yeast Yarrowia lipolytica. Most of the side chain modified analogues were recognized as 24-SMT inhibitors, and in particular the 23-azasteroids 5f-5i and the 24-azasteroid 11 showed potent antifungal activity. The target enzyme could be identified unambiguously using an improved whole-cell assay combined with GC-MS analysis of the sterol pattern resulting upon incubation with the inhibitors.