Microgrids are an ideal way of electricity generation, distribution, and regulation for customers by means of distributed energy resources on the community level. However, due to the randomness of photovoltaic and wind power generation, it is a crucial and difficult problem to achieve optimal economic dispatch in microgrids. In this paper, we present an optimal economic dispatch solution for a microgrid by the improved artificial bee colony (ABC) optimization, with the aim of satisfying load and balance demand while minimizing the cost of power generation and gas emission. Firstly, we construct a mathematical model according to different characteristics of distributed generation units and loads, and improve the performance of global convergence for ABC in order to fit such model. Secondly, we explore how to solve the optimal economic dispatch problem by the improved ABC and give the essential steps. Thirdly, we carry out several simulations and the results illustrate the benefits and effectiveness of the proposed approach for optimal economic dispatch in microgrid.