capecodder avatar image
capecodder asked

vba error user_defined type not defined

when trying to open a excel 2016 spreadsheet from SAP, I get the following error, compile error: user-defined type not defined. The laptop is win10.[link text][1] this works on win7 machines with office 2013. [1]: /storage/temp/4415-sap-vba-error.docx i'm not a vba programmer, so any pointers would be great!
sap-vba-error.docx (171.5 KiB)
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

@capecodder Most likely this means that the project needs a reference to the type library which is missing. To validate, open the References dialog. This will probably show that the reference to SAXXMLReader60 is missing. There might be some other missing references. This problem probably has nothing to do with the OS of the machine. If it works on win7 boxes then it means that they have the libraries which are required for the spreadsheet macros to work already installed.
0 Likes 0 ·
I found this poking around and found this from someone that had same issue in Win10 as I do :"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: "DOMDocument" to "MSXML2.DOMDocument60" "XMLHTTP" to "MSXML2.XMLHTTP60" Does this sound like fix?
0 Likes 0 ·
Also my dba says it's an oracle known issue. How can it be an oracle issue when it says microsoft visual basic for application...
0 Likes 0 ·
@capecodder The odds are that your problem is related to missing reference. You can invoke the References dialog via **Tools** -> **References** while you have the VBA window open. If anything is missing than it will feature the word "Missing" to the left of the library name. What your DBA probably means is that the VBA code references some custom type library, so it is possible that said library is provided by some third party (for example, by Oracle) and the library either does not work or is missing. The **References** dialog should reveal the source of the problem.
0 Likes 0 ·
Apparently the DBA said we needed to download a few patches..which really doesn't explain, why the error happened. We also need to test WebADI to see if this is resolved as well. Thanks all.
0 Likes 0 ·

0 Answers


Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.