What was the brand name of the pills you tried first? Was it Interceptor? Are you also giving any other medications at the same time or on the same day that you give the HW meds, for example, flea treatment?
Here is a table showing the ingredients of many of the most popular brands on the market:
Dog Heartworm Preventive Products Comparison Chart