Click here to Skip to main content
15,794,275 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,
My requirement is, I want to read a XML file node value and want to write into Excel file by using console application in VS C#, any links please, bit urgent

Thanks in Advance

What I have tried:

Require a console application to read data from xml file
Updated 26-Jul-23 18:01pm
Patrice T 26-Jul-23 22:25pm    
Why not read xml file directly in Excel ?
PIEBALDconsult 27-Jul-23 1:11am    
0) I would use the ACE Engine and, but it's not a straight-forward proposition.
1) Always look for ways to break a task into smaller sub-tasks:
   1.1) Read XML
   1.2) Write to Excel

1 solution

There's at least two solutions to write Excel files from VS. But I don't code in C#,

First, .net (at least the framework) as all classes you need to read XML files


Writing Excel files from .net is possible from a .net application:

OpenXML Sdk :

Welcome to the Open XML SDK 2.5 for Office | Microsoft Learn[^]

or COM interrupt

How to access Office interop objects - C# Programming Guide | Microsoft Learn[^]

Microsoft.Office.Interop.Excel Namespace | Microsoft Learn[^]

You can get a VBA macro using Excel macro recorder. Converting VBA to C#, should not be to difficult.
Share this answer
CPallini 27-Jul-23 2:06am    
BTW: it is COM 'interop' (not 'interrupt').

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

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900