PC Review


Reply
Thread Tools Rate Thread

C#NET2008 Using OPENXML transfer XML file data directly into EXCEL 2003

 
 
New Member
Join Date: Nov 2010
Location: New Zealand
Posts: 2
 
      9th Nov 2010
Hullo Good Guys,

I am using c#NE2008, XML, Excel 2003.

I tried transfer XML file data directly into EXCEL 2003 using OPENXML it did does work but did not produced a proper Excel Column Header Text:

This is the coding:
xlWkBook = xlApp.Application.Workbooks.OpenXML(strXMLFile, oMissing, oMissing);



I need your help, please help me. Thank you.

Once I got the coding working based on your helps, I will post the coding here to share with other Newbies who may have similar problems.


Code:
private void BtnExportExcel_Click(object sender, EventArgs e)
 
		{ //export directly from XML to Excel 2003
 

 
			string strXMLFile = @”F:\SalesDept\OrderXML.xml”;
 
			object oMissing = System.Reflection.Missing.Value;						 
 

 
			Excel.Application xlApp = new Excel.ApplicationClass();
 
			Excel.Workbook xlWkBook;
 
			Excel.Worksheet xlWksheet = null;
 
			xlApp.Visible = true;
 

 
		 xlWkBook = xlApp.Application.Workbooks.OpenXML(strXMLFile, oMissing, oMissing);							 
 
	 }


-----------------------------------------------------------------



XML FILE DATA STRUCTURE













FRANK

10267

29/07/1996

26/08/1996

06/08/1996

208.58





FRANK

10337

24/10/1996

21/11/1996

29/10/1996

108.26









------------------------------------------------------------------------------



EXCEL 2003 SPREADSHEET RESULT



/table















/row/CustomerID

/row/Freight

/row/Freight/#agg

/row/OrderDate

/row/OrderID

/row/OrderID/#agg

/row/RequiredDate

/row/ShippedDate

FRANK

208.58

208.58

29/07/1996

10267

10267

26/08/1996

06/08/1996

FRANK

108.26

108.26

24/10/1996

10337

10337

21/11/1996

29/10/1996







Looking forward for your help. I am desperate to deliver the Application. Appreciate your help very much. Thank you.


Have a Good Day,
Cheers,
Lennie
Attached Files
File Type: doc XMLEXCEL2003.doc (33.5 KB, 30 views)
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I transfer data from one worksheet to another? (Excel 2003) Abeba Microsoft Excel Misc 0 3rd Jun 2009 05:04 PM
CSV File Will Not Open Directly in Excel 2003 Anna_Stephanie Microsoft Excel Misc 4 10th Mar 2009 08:17 PM
Transfer data directly to Excel spreadsheet Associates Microsoft Access VBA Modules 3 30th Jun 2008 08:08 AM
Re: Can you FTP a file/data directly into Excel R.VENKATARAMAN Microsoft Excel Misc 0 10th Aug 2005 02:46 PM
Use ADO to transfer data from open excel file to closed excel file =?Utf-8?B?SkNhbnlvbmVlcg==?= Microsoft Excel Programming 1 1st Apr 2005 07:41 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:44 AM.