VBA to interface with civil reports?

i'm wanting to pull some values from the civil reports to be used in a VBA program inside OpenRoads. i know the files are routed to the appdata\local\temp but i cant track the latest file name other than actually looking into the folder.

is there a way i can capture the .xml file name as its created or is there a means for me to redirect the save folder for the report when my code runs?

if i can redirect it only when the code runs i can have it delete the file at the end of the code run


  • Nice work there. I noticed you were looking at a few other xml reporting options. in that case i would recommend adding a form option to choose the type of xml report. ORD currently makes them all as individual instead of a collective so being able to choose the report will prevent the need of rerunning the command or re-coding. in which case you would have the form pass the report search texts. IE "Horizontal Geometry Report" & "Superelevation Report" that will of course open you up to alot of other potential reports like quantities and earthworks. on the other end if you wanted to process all reports I would have it check each name. the long slog is actually getting rid of information you dont want but thats just some parsing and formatting.

  • If you're referring to the sub research_Xml(), that's just a proof of concept. As familiar as I am with XSLT (and thus xpath), what I was particularly interested in is maintaining use in VBA of that for selection of nodes and attributes. 

    What do you mean that ORD currently makes them all as individual, particularly in your added commentary that you won't need to re-run the command? What I want to do more than anything is revealed in these comments found at the top of function GetLatestXmlFile:

    'HorzXml = GetLatestXmlFile(, "*Horizontal Geometry Report*")
    'SuperXml = GetLatestXmlFile(, "*Superelevation Report*")
    'so we can process geometry and super together to highlight where we expect to see problems in cross slope or longitudinal slope
    'make sure to check for a common baseline alignment (Baseline is listed in the arguments but isn't currently used)
    'make sure to overcome the units mismatch in internalStation

    With such functionality, I could process the xml of the horizontal report and the xml of the superelevation report in parallel to coordinate between them.