Click here to Skip to main content
12,399,362 members (59,182 online)
Rate this:
Please Sign up or sign in to vote.
See more: C# MS-Excel PDF
Hi guys,
Can anyone help me to generate a macro using c#. I want that macro to be enabled after selecting 2 columns and generate pdf files with a particular format as follows:


XYZ School,USA
Name ValueOfColumn1&Row1

Age ValueOfColumn2&Row1


XYZ School,USA
Name ValueOfColumn1&Row2

Age ValueOfColumn2&Row2

Please help me out!
Posted 5-Jan-13 1:58am
Zoltán Zörgő 6-Jan-13 6:10am
Any progress?
Akkywadhwa 15-Jan-13 4:49am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Macro using c#? C# is not a macro language - you either do your job using Excel VBA or C#... From Excel 2007 and above you can export to PDF without any external component, but you need to make your "file" as a sheet of the workbook to look as you desire. Than you can change the worksheet's content and generate the pdf's one by one. Here is a sample of how to use VBA to export to PDF:[^], related official support:[^].

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.160721.1 | Last Updated 5 Jan 2013
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100