LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9
Default Excel Macro via VBA - XML IMPORT

I wonder if someone can help me with what i need code wise in the ' HELP here
please
below.

I want to update EXISTING records from an xml source using the XML data.
Details are in the sample code below.

Many thanks in advance

Sub Read_XML_Data()
Dim rst As ADODB.Recordset
Dim stCon As String, stFile As String
Dim i As Long, j As Long

' This has row records which have the rows "NAME" in Column A
' then updates to other colums within the row
' NB: Only some of the row columns will be updated.
stFile = "C:\myupdates.xml"
stCon = "Provider=MSPersist;"

With rst
.CursorLocation = adUseClient
.Open stFile, stCon, adOpenStatic, adLockReadOnly, adCmdFile
Set .ActiveConnection = Nothing
End With

With ActiveSheet
' HELP here please
' Find the row with the same "NAME" as what is in the XML record
' code here
'Copy the data from the XML recordset for this "NAME" into the row
'.Range("... rst....
End With
'Closing the recordset.
rst.Close

'Release object from memory.
Set rst = Nothing

End Sub

XML
<row
<namefred</name
<age24</age
</email
</row
....
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
import from excel to access with macro? J.W. Aldridge Excel Programming 2 April 30th 09 09:05 PM
Excel Import Macro gkarasiewicz Excel Discussion (Misc queries) 5 January 12th 08 06:08 PM
Import Macro in PERSONAL.XLS will not import to my main document mike Excel Programming 8 October 31st 07 09:24 PM
Import Data Excel Macro [email protected] Excel Discussion (Misc queries) 3 August 23rd 06 02:11 PM
Use / Import Win32API in Excel macro Ben Zhu Excel Programming 2 September 10th 03 09:37 PM


All times are GMT +1. The time now is 12:20 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"