Web Xml is not loading on a specific machine (vba)

nd0911

Board Regular
Joined
Jan 1, 2014
Messages
166
Hello,

I'm trying to load an XML from the web to an object in VBA, it works on every machine exapt one (my server).

This is the code:

VBA Code:
Dim URL As String
Dim XmlObject As Object

Set XmlObject = CreateObject("MSXML2.DOMDocument.6.0")

URL = "https://old.cbs.gov.il/reader/pirsum_madad/indices_heb.xml"

XmlObject.async = False 
XmlObject.Load (URL)
'the code continue.....

on every machine the last line of code (XmlObject.Load (URL)) in the "Locals Window" the relevant properties are full, on this specific machine its all empty.

same office 365 on all machines.

what do you think could be the problem ?

thank you.
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
Try testing whether the document has loaded successfully. If it fails, check the parseError property of the Document object for the reason...

VBA Code:
    If XmlObject.Load(Url) Then
        'document loaded successfuly
        '
        '
    Else
        'document failed to load
        With XmlObject.parseError
            MsgBox "Error " & .ErrorCode & ": " & .reason, vbCritical, "Error"
        End With
    End If

Hope this helps!
 
Upvote 0
maybe try Power Query as alternative

#VALUE!


and so on....

Code:
// date
let
    Source = Xml.Tables(Web.Contents("https://old.cbs.gov.il/reader/pirsum_madad/indices_heb.xml"), null, 1255),
    #"Expanded Table" = Table.ExpandTableColumn(Source, "Table", {"code", "Attribute:year", "Attribute:month", "Attribute:noNamespaceSchemaLocation"}, {"code", "Attribute:year", "Attribute:month", "Attribute:noNamespaceSchemaLocation"}),
    #"Expanded code" = Table.ExpandTableColumn(#"Expanded Table", "code", {"name", "percent", "index", "Attribute:code"}, {"name.1", "percent", "index", "Attribute:code"}),
    #"Expanded index" = Table.ExpandTableColumn(#"Expanded code", "index", {"Element:Text", "Attribute:base", "Attribute:chainingCoefficient"}, {"Element:Text", "Attribute:base", "Attribute:chainingCoefficient"}),
    #"Removed Columns" = Table.RemoveColumns(#"Expanded index",{"Attribute:noNamespaceSchemaLocation", "Name"})
in
    #"Removed Columns"
 
Last edited:
Upvote 0

Forum statistics

Threads
1,214,954
Messages
6,122,461
Members
449,085
Latest member
ExcelError

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top