Open UteJosh opened 1 year ago
I just checked and the program 1.4 should still work. When you get this error, click on "debug" and you should see the VBCode window come up with a yellow highlighted line to show where the error occurred. Can you screenshot that window and send to me?
Also, check if you have the following VBA references checked. Follow the steps below to check:
heres the screenshot, ill be back in a bit to get the other one.
when i go to the data sheet's code, and access tools, references is grayed out.
You need to stop the debugger first... hit the little stop buttun next to the pause button
ok i got it
they were checked
also, did some research lol (ChatGPT is great)... says your error is an overflow message - something with the way I coded the LoadDocument routine... seems weird, as it works on my machine. Anyways, I have rewritten the routine - just copy and paste this over the routine you have, if you feel comfortable doing that. Otherwise I have update in v1.5 which you can download in a bit.
Public Sub LoadDocument(EXML_Filename As String) ' Routine to load an EXML file and parse it's contents, and then ' lay out the EXML structure on the sheet, based on the passed ' EXML document name.
Dim CurretRow As Long Dim SN_Node As IXMLDOMNode Dim CurrentCol As Long Dim CurrentLevel As Integer Dim elementCount As Long Dim v As Variant
' Check that the passed filename is not blank If EXML_Filename = "" Then MsgBox "No filename found, select a Family CreatureID name" Exit Sub End If
' Disable Screen Processing DisableScreenProcessing
WaitForEXMLForm.Show DoEvents
' create the XML Document Object Model (DOM) Set xDoc = CreateObject("Microsoft.XMLDOM") ' Set validation for parser for well-formed XML only xDoc.validateOnParse = False ' Get the XML file If xDoc.Load(ThisWorkbook.Path & "\EXML\" & EXML_Filename) Then ' The document loaded successfully.
' Get the length of XML elements
elementCount = xDoc.SelectNodes("//*").Length
' write xml info to array with exact or assumed items count
ReDim v(1 To elementCount, 1 To 2)
' Get the nodes
getChildNodes xDoc.DocumentElement, v
' Clear the data area
ClearDataArea
With NMSData
' iterate through the 2-dimensional array
For r = 1 To UBound(v)
' Check for indents over 35
If v(r, LVLColumn) >= 35 Then
.Range(ColLetter(Int((v(r, LVLColumn) - 2) / 5) + 1) & r + HeaderRow) = v(r, NAMEColumn)
Else
.Range(ColLetter(Int(v(r, LVLColumn) / 5) + 1) & r + HeaderRow) = v(r, NAMEColumn)
End If
.Range("A" & r + HeaderRow) = v(r, LVLColumn)
Next r
End With
' error check that activecell is in family range
If ActiveCell.Row <= HeaderRow Then
NMSData.Cells(HeaderRow + 1, NMSData.Range("Family_Rng").Column).Activate
End If
' error check that activecell is in family range
If ActiveCell.Row > NMSData.Range("Family_Rng").Rows.Count + HeaderRow Then
NMSData.Cells(HeaderRow + 1, NMSData.Range("Family_Rng").Column).Activate
End If
' Update the currrently loaded info
NMSData.Range("Curr_Fam_Name_Rng").Value = Cells(ActiveCell.Row, NMSData.Range("Family_Rng").Column).Value
Else ' The document failed to load. MsgBox "EXML file did not load" & vbCrLf & _ "Check if " & EXML_Filename & " exists in the directory!"
End If
Cleanup:
' Hide waiting screen WaitForEXMLForm.Hide
' Set the global variable for last row on sheet SetLastDataRow
' Enable Screen Processing EnableScreenProcessing
' scroll up to top ActiveWindow.ScrollRow = 3
End Sub
ok
thank you!!
i think ill wait for 1.5, as im not familiar with code
thanks!!!
sorry for the wait, i had little time to test
i got the same error. am i misusing it?
Mmmm... run the debug and screenshot back to me again. I haven't had this error before, you are the first to report. I do not get it on my system with v1.4 or v1.5, so it's a mystery... Can you verify Excel version, Operating System and RAM you currently have?
i dont know how to get my excel version, but i am on windows 11 with 25.8 GB of ram.
wait the ram might be wrong
8.0 GB of ram
I think it's either your version of Excel and possibly the version of the EXML parser. You can try changing the line: Set xDoc = CreateObject("Microsoft.XMLDOM")
To: Set xDoc = CreateObject("MSXML2.DOMDocument")
Do this by:
Thank you!! One question, (i apologize for my foolishness) but where do i find the LoadDocument routine?
i found it nvm
it happened again. this might be unsolvable.
Well, from here, I would start looking at the version of Excel you have, and the XML Parser. I developed this being compatible with Microsoft Office 365 Excel (Microsoft® Excel® for Microsoft 365 MSO (Version 2305 Build 16.0.16501.20074) 64-bit) Check your version of C:\Windows\System32\msxml6.dll (see my screen shot attached) Here is the update page for this Type Library: https://support.microsoft.com/en-us/topic/description-of-an-update-for-msxml-core-services-6-0-service-pack-2-9b310b5a-3a90-ebc3-e1bd-97b42266b1ef
believe we've found it
wait hold on
whenever i select 'load EXML' on the excel form, it gives me an error that says 'Run-time error '-2147483638 (8000000a)':' what should i do to fix this?