View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default read xml and fill valuesin excel form combobox

XML files are text files. The code below can read text files. You need to
write code that will filter the XML files and extract the data you are
looking for. If you post the XML data I can help you write the filter


Sub Gettext()

Const ForReading = 1, ForWriting = 2, ForAppending = 3
Const TxtDirectory = "C:\temp\"
Const ReadFileName = "test.xml"
Const TristateUseDefault = -2, TristateTrue = -1, TristateFalse = 0

Set fsread = CreateObject("Scripting.FileSystemObject")
ReadPathName = TxtDirectory & ReadFileName
Set fread = fsread.GetFile(ReadPathName)
Set tsread = fread.OpenAsTextStream(ForReading, TristateUseDefault)

RowCount = 1
Do While tsread.atendofstream = False

InputLine = tsread.ReadLine
'add filter code here
Loop
tsread.Close

End Sub

"born2achieve" wrote:

Dear friend,
i have created form in excel macros
i have one combobox in my excel form. i need to read my xml which is in
"c:\default.xml" and have to display the values in combobox.
.in my xml i need to take loop the " name" node and display all the names
which is in my xml.so please help me to achive my requirement.please show
some example for thi splease
can any one give vba code to read xml vaues please