Abstract:EXCEL is a Microsoft Office software product, which has excellent numerical and logic calculation and analysis functions .The method of programming a CNC macro program using EXCEL is being presented for the first time .By defining the locations of a hole pattern geometrically, and simulating the programming of a macro, it can be demonstrated that a CNC program that uses macros is simple and easy to understand, and the program is flexible, generic and portable.