"User-defined type not defined" error when upgraded to Windows 10 and Excel 2016

wilkisa

Well-known Member
Joined
Apr 7, 2002
Messages
657
Office Version
  1. 365
  2. 2016
  3. 2013
Platform
  1. Windows
Many of our users have been getting errors in Excel with macros that worked perfectly fine in all older version of Excel. Now that they are using Windows 10 and Excel 2016, the "user-defined type not defined" error comes up each time it hits a UDF statement. It is as follows:

HTML:
Function uploadProdXMLDoc(doc as MSXML2.DOMDocument) asMSXML2.DOMDocument60

Dim request as XMLHTTP
Set request =New XMLHTTP
Set uploadProdXMLDoc = Nothing

With request
.Open “POST”, http://myintranet.mycompany.com/myshare/myfolder/myreportUploadAPI.aspx,False
.setRequestHeader “content-type”, “application/xml”
.setRequestHeader “user-agent”, “prod-report-excel-workbook”
.send doc.XMLDebug.Print .responseText
Set uploadProdXMLDoc = NewMSXML2.DOMDocument60
Upload ProdXMLDoc.LoadXML.responseText
End With

Set request = Nothing

End Function


Can someone please help me modify these UDFs so they will work in Excel 2016? I'm sure we need to change some of the statements but don't know what to change. The references turned on for these documents are:
Visual Basic for Applications
Microsoft Excel 16.0 Object Library
OLE Automation
Microsoft Forms 2.0 Object Library
Microsoft Office 16.0 Object Library
Microsoft XML, v6.0

Any guidance you can give will be very gratefully appreciated
 
Last edited:
Joe4 - as to the curly quotes, it is because my IE or Firefox would not allow me to copy/paste my code so I typed it into Word and then it allowed me to copy/paste.

John_1 - Thank you so much! This item did the trick and I have now got my user working correctly. I stepped through the macro and changed all MSXML2.DOMDocument references to MSXML2.DOMDocument60 and all XMLHTTP references to XMLHTTP60. I'm am documenting these changes so I hopefully will not have to ask again when the next user calls.

Again, John_w and Joe4, thank you so much for your assistance. I am very grateful.
 
Upvote 0

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.

Forum statistics

Threads
1,223,214
Messages
6,170,774
Members
452,353
Latest member
strainu

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