A method and an apparatus of extracting lipids from microalgae are provided. In the method, pressurized carbon dioxide (CO2) is dissolved in a liquid alcohol to form a CO2-expanded alcohol solution at a pressure of about 400-1500 psi and a temperature of about 30-65° C. Next, the CO2-expanded alcohol solution contacts microalgae to extract the lipids from the microalgae. A method and an apparatus of preparing fatty acid esters from microalgae are disclosed as well.