Hey! I just made some small changes while continuing to work on the program (not trying to fix the process problem) and now I no longer have the process hanging! I'm not exactly sure what fixed it but I imagine it has to do with the formatting and syntax problems I fixed.
Thanks for your help...
Ah, right. Ok thats fixed. So now my code is a whole lot cleaner (thanks!) but I'm still having the same initial problem...
I don't get it, it should be closing...
Would it maybe be that I'm loading the XML file (xmlDoc) and not "closing it" or something? Would that cause it to hang? I'm just...
Ok, so I fixed the "Activesheet" references but Excel is still hanging in the Processes...
This is what I fixed my code to:
Sub XMLtoExcel()
'Create and load the XML file
Dim xmlDoc As MSXML2.DOMDocument
Set xmlDoc = New MSXML2.DOMDocument
xmlDoc.Load ("C:\Documents and Settings\Desktop\Test...
oops, I'm still referring to "Activesheet" in this code, could that be the problem?
I'll fix the syntax and try it again and I'll repost my code.
My bad
That is strange. And yes I did make the modifications. Here is my complete code:
Sub XMLtoExcel()
'Create and load the XML file
Dim xmlDoc As MSXML2.DOMDocument
Set xmlDoc = New MSXML2.DOMDocument
xmlDoc.Load ("C:\Documents and Settings\Desktop\Test XML Files (Copies)\test.xml")
'Create the...
I stepped through and excel opens when I reference my xl Object. Then, as I suspected, it just doesn't close. Are there any other possible syntax errors? Or something component that I'm forgetting to close?
Ya I felt like my syntax was a little off. Anyways, I made the changes which you suggested and I still have the problem of the process not ending. Any idea why this is still happening?
Hey All,
I have some VBA code in Word that opens Excel and puts values into a bunch of cells on several Worksheets, but only one workbook. Then when my code finishes I find that the Excel process is still running in the task manager. I thought I had used to proper code to close it properly but...
Oh nevermind, I figured it out. I created temporary strings to hold the values of the attributes and then placed them in as I was looping instead of trying to use ".NextSibling". Here's my code for my loop in case anyone is interested:
Dim date, min, avg, max, valid As String
For i = 0 To...
Hey All,
So I have a bunch of XML nodes that look like this:
<TREND_VALUE
DATE_TIME="20100729101005"
MIN_VALUE="-12"
AVG_VALUE="0"
MAX_VALUE="0"
VALID="TRUE"
/>
<TREND_VALUE
DATE_TIME="20100729102005"
MIN_VALUE="-24"
AVG_VALUE="-12"...
Oh, so another quick question.
Is there a way to grab just the "type" of the attribute?
For example, only grab "NAME"? Cause I know that .Text will just give me "Jim" and .XML will give me the whole thing, "NAME='Jim'". So how would I just get "NAME"?
Awesome, thanks Tony. Works great! And thanks PHV for the link, I wasn't sure what I was looking for before but now I know they are "Attributes".
Thanks for the help guys.
BitNet
Hey,
So I'm opening XML files in Word and using VBA to extract data from certain XML nodes using DOM. My Code looks like this:
Sub Extract()
Dim xmlDoc As MSXML2.DOMDocument
Set xmlDoc = New MSXML2.DOMDocument
Dim nodeList As MSXML2.IXMLDOMNodeList
Dim str As String...
Thanks SkipVought! That worked perfectly! and no its not an existing workbook.
One question about saving the file, can I save the name of the .xlsx file using a variable?
Hey all,
I have a string in Word that I have Parsed using the Split() function and now want to export each element of the array into Excel so that all of the elements are in the same collumn but the rows get incremented with a single element in each row.
For example,
Dim str as String
str =...
Thanks for your help fumei. I'm pretty ignorant in this area too haha, hence all the problems I'm having.
Tony, I thought that that might be the problem as well, so I tried playing around with the "customer/name" portion. I'm not sure of exactly the format it needs. Do you need to include every...
Ok so I've decided to use XML DOM, which I think is what Tony was talking about. So I now have this code:
Sub FindNode()
Dim xmlDoc As DOMDocument
Dim xmlNode As IXMLDOMNode
Set xmlDoc = New DOMDocument
xmlDoc.async = False
xmlDoc.Load ("C:\Documents and Settings\User\Desktop\Customer.xml")...
I am opening XML files in Word and am trying to extract certain fields from the huge XML file so that I only have the portions of it that I need. When I open the XML file in word it sees the fields (ex "<customer>" and "</customer") as a "tag". How can I use VBA to reference those tags so that I...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.