I have Access VBA scripts to pull data from a number of web sites. These worked perfectly with office 2013 and Windows 7. However, since upgrading to Windows 10 I have been getting intermittent errors (not necessarily in the same place with the same data) or sometimes data is not being extracted from the tags. It appears too occur when I access a specific tag with a specific index e.g.
I'm using IE as the browser object created as follows:
Is there anything that upgrading Windows could have broken? (Novice, so apologies for any incorrect terminology)
Halvor Holsten Strand15.7k1414 gold badges5858 silver badges7474 bronze badges
woodywoody
![Xdoc as domdocument windows 10 free Xdoc as domdocument windows 10 free](/uploads/1/2/3/7/123717335/103468614.png)
1 Answer
Consider using the MSXML's IXMLHTTPRequest object for web server requests. IE is no longer a dedicated browser on Windows, so may not fully support automation going forward with Windows 10.
ParfaitParfait58.1k1010 gold badges5353 silver badges7373 bronze badges
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Not the answer you're looking for? Browse other questions tagged vbainternet-explorer-11ms-access-2013 or ask your own question.
I have written a VBA macro to load and parse an XML file. This exact code has worked fine for awhile, but now it's no longer functioning. I've tested it on two different computers running Excel 2013 64-bit. The code it fails on is below:
The code continues if I comment out the Set command. It doesn't throw an error, it crashes Excel entirely. The code above is where the macro starts, there is no code running before it. I have set a reference to v6.0 of MSXML
BishopBishop
1 Answer
For a 64 bit Windows OS you should put your msxml6.dll inside of
C:WindowsSysWOW64
and then register it from that location, by running this command in your command prompt regsvr32.exe C:WindowsSysWOW64msxml6.dll
.Make sure that you run you command prompt as Administrator.
João PinhoJoão Pinho3,16911 gold badge1111 silver badges2727 bronze badges
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Not the answer you're looking for? Browse other questions tagged xmlexcelvbaexcel-vbamsxml6 or ask your own question.
I am trying to import xml data into excel.So the first line of the code is
Dim XMLDOC As MSXML2.DOMDocument
and this gives an error 'user defined type not defined'
JimmyPena7,89655 gold badges3737 silver badges5959 bronze badges
user1486889user1486889
4 Answers
Inside the VBE, Go to Tools -> References, then Select Microsoft XML, v6.0 (or whatever your latest is. This will give you access to the XML Object Library.
Updated with fancy pic!
Scott HoltzmanDomdocument Not Defined
Scott Holtzman23.7k66 gold badges2727 silver badges5454 bronze badges
I had
DOMDocument
defined which needed Microsoft XML, v3.0
but I had Microsoft XML, v6.0
selected in references which caused the below error 'user defined type not defined'.
Obd auto doctor code. The solution
Windows 10 Dim Xdoc As Domdocument
The solution was to either change
Joshua DuxburyJoshua DuxburyDOMDocument
to DOMDocument60
(60 uses ver 6.0) or use the Microsoft XML, v3.0
reference with DomDocument
. 2,32822 gold badges1515 silver badges3939 bronze badges
I work with a VBA Excel Macro that someone else wrote and I was tasked with fixing it after recently upgrading from Windows 7 / Office 2010 to Windows 10 / Office 2016. I started to receive the same 'user defined type not defined' compile error. My previous install also had MS XML v6.0 but apparently you have to specifically point to this version in your code on Windows 10 and/or Office 2016 (I wasn't able to confirm which upgrade caused the issue). I was able to resolve the issue by doing a Find/Replace on the following:
ChanelChanel
Xdoc As Domdocument Windows 10 64
I am using Microsoft Windows 10 & Office 2016.
Using Microsoft XML 6.0 does not fix the problem.
Selecting Microsoft XML 3.0 fixed the compilation error
Abdelhameed MahmoudAbdelhameed Mahmoud1,87522 gold badges1818 silver badges1717 bronze badges