Excel Vba Compile Error User-defined Type Not Defined
Contents |
here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring compile error user-defined type not defined excel 2010 developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question excel macro compile error user-defined type not defined x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them;
User-defined Type Not Defined Excel 2013
it only takes a minute: Sign up Excel VBA Compile throws a “User-defined type not defined” error but does not goto offending line of code up vote 10 down vote favorite 4 Symptoms This is a symptom specifically when compiling
Excel Vba Compile Error Variable Not Defined
an Excel VBA project. The following error occurs: User-defined type not defined However, the code that produces this error is not highlighted by the compiler and so I cannot identify the issue. What I already know and have tried This is a "User-defined type not defined" error that I have seen before with simple issues such as naming something As Strig instead of As String. However this particular error is only popping up during the Debug > Compile VBAProject excel vba compile error sub or function not defined menu option and when the error message box pops up it does not highlight the line of code that the error is occuring in. After a lot of research I have found that this bug can be related to missing references and I have ruled this out as I have included all needed references and Toolbox objects. To ensure I wasn't missing any obvious missing Dim statements I have added Option Explicit to all code pages (forms included) to make sure nothing was missing. The error still shows when running a compile. There is also this known bug that states the issue has been known to happen because of the VB6 projects using binary compatibility: Turn off Binary Compatibility and compile the project. Visual Basic will highlight the line of code that contains the User Defined Type that is not defined. After resolving the problem, Binary Compatibility can be turned back on. I found this article via this Question and Answer, however, I cannot find this option in the standard Excel VBA editor. Help save mine and others' sanity! I know from Google searches and other questions that I am not the only one who has had this issue. I have tried going through the code manually but there are simply too many lines to feasibly do so. Is there a way of turning off Binary Compatibility in Excel VBA projects? How do people find this offen
be down. Please try the request again. Your cache administrator is webmaster. Generated Sat, 15 Oct 2016 07:59:38 GMT by s_wx1094 (squid/3.5.20)
Forums Excel Questions Excel 2010 VBA Error: Compile error User-defined type not defined Results 1 to 4 of 4 Excel 2010 VBA Error: Compile error User-defined type not http://www.mrexcel.com/forum/excel-questions/591688-excel-2010-visual-basic-applications-error-compile-error-user-defined-type-not-defined.html definedThis is a discussion on Excel 2010 VBA Error: Compile error User-defined type not defined within the Excel Questions forums, part of the Question Forums category; Hi, I'm seeking to run some VBA https://port135.com/2012/08/25/resolution-for-user-defined-type-not-defined-error-at-declarations-of-excel-variables-vba/ code in Excel 2010 on a Windows XP machine. The goal of the ... LinkBack LinkBack URL About LinkBacks Bookmark & Share Digg this Thread!Add Thread to del.icio.usBookmark in TechnoratiTweet this compile error thread Thread Tools Show Printable Version Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode Nov 11th, 2011,01:26 PM #1 TomTTT New Member Join Date Nov 2011 Posts 8 Excel 2010 VBA Error: Compile error User-defined type not defined Hi, I'm seeking to run some VBA code in Excel 2010 on a Windows XP machine. The goal of the code is to excel vba compile take a large Excel file and break it down into a set of distinct files (e.g. Report_Department100, Report_Department200, Report_Department300) which will then be examined and emailed out to the various departments. Here is the error I get when I attempt to run it: "Compile error: User-defined type not defined." Excel highlights the "Dim DB As Database" line specifically. Here is the context of the code: Code: Sub CreateFiles() Dim DB As Database Dim rst As Recordset Dim rst2 As Recordset Dim strSQL As String Dim DeptID As String Dim CustID as DAO.QueryDef Dim FilePath As String What do you suggest I do to address this problem? Share Share this post on Digg Del.icio.us Technorati Twitter Reply With Quote Nov 11th, 2011,01:35 PM #2 pgc01 MrExcel MVP Join Date Apr 2006 Posts 18,222 Re: Excel 2010 VBA Error: Compile error User-defined type not defined Hi Tom Welcome to the board You must be missing (at least) one reference. Check the documentation of the code you are using. In the VB Editor, in Tools->References you must set the appropriate references. My first guess is Microsoft DAO Object Library Share Share this post on Digg