There are some conditions that can prevent you from taking metformin. These include:
Lactic acidosis: The use of metformin is associated with lactic acidosis. It is rare but can be very serious for less than 1% of all patients taking metformin.
Surgery or scans: If you're having surgery or scans that involve administration of a contrast dye may require you to stop taking some medications. You may need to stop metformin on admission and not restart until at least 48 hours afterwards dependent on the advice of your doctors.