Search code examples
c#excelcode-generation

Is there a code generation tool that accepts Excel files as input?


I'm looking to generate some C# code based on Excel data. Basically the Excel sheet contains definitions of functions that need to be generated in C#.

My current experience with code generation is mainly with ORM's. But now the "input" is Excel data.

I'm asking this to prevent me from re-inventing the wheel. Reading data from Excel is easy, and generating C# also. But I'm a lazy programmer.

Is there a code generation tool that accepts Excel files as input?


Solution

  • You can use T4 templates. I know this too common/abstract answer, but this is the way, I think, and I don't think you can find something already exist for that purpose. Visual Studio 2008 has native supports for them. In your T4 template you can read excel file and then use its data to create any code file you want.