compile error

  1. Engineer Joe

    Compile Error: User-defined Type Not Defined on "Dim AppClass As ExcelEventClass" line in This Workbook code

    The VBA in this workbook worked flawlessly and then one day I got this compile error upon opening. Code is shown below. Option Explicit Dim AppClass As ExcelEventClass Private Sub Workbook_AddinInstall() End Sub Private Sub Workbook_BeforeClose(Cancel As Boolean) Call...
  2. M

    Compile error from Office 2010 to Office 365: Variable not defined

    Hello, I have to migrate a very old excel file with many macros from Office 2010 to Office 365 (Office 2010 being no longer supported). The Excel file works perfectly on Office 2010. When I run the VBA compiler, I get the following error message: Compile error Variable not defined Here is the...
  3. H

    All of a sudden, all macros are now failing due to Compile error: Expected Function or variable

    I've been using these macros for months and recently every single macro that I normally use is failing due to the Compile error: Expected Function or variable. I sent the below script to a coworker and they were able to run it on their system with no issues. Sub Cleaner_Surveillance() ' '...
  4. M

    Compile error: Variable not defined

    I'm using a code that was working perfectly. A few weeks went by before I had to use it again and now I'm getting the subject error. The error flags when it gets to line 12 at the "ws.Control.ListObjects..." It seems that the code isn't finding the worksheet named "Control," even though that...
  5. M

    compile error 64 bit - Mouse scroll code

    Hi, This code allows me to use the scroll wheel on my userforms. I've been using this bit of code successfully but now i have a 64 bit system and its throwing up the following error: Compile error: The code in this project must be updated for use on 64-bit systems. Please review and update...
  6. dss28

    Convert Numbers (currency) to text

    I am using the attached code for converting numbers (currency) into text. The code was working fine but now gives a "Compile error : Cant find project or library" please help to find what has gone wrong now. the code stops at "ReDim Place(9) As String" line. Function SpellIndian(ByVal...
  7. V

    Set fs = Application.FileSearch doesn't work in newer versions of Excel

    I am converting an existing MS Excel spreadsheet from Office XP to Office 2016. When running the VBA code I get an error. Run-time error '445': Object doesn't support this action The debug windows highlights this part of the code: Set fs = Application.FileSearch I changed...
  8. V

    Compile error on workbooks statement

    Hi, I am having trouble reffering to any workbook using workbooks statement. Every time I try using the workbooks statement I get compile error despite copying the code from tutorial. Example in the image. Any suggestions? Thanks
  9. Q

    Compile Error for defining a function in VBA

    macroTest1 runs fine when the entire function is commented, but this error comes when I comment the function I am using the following references can someone help me with it?
  10. D

    (Fast read!) Send out email automatically with attachment through command button

    Hello everybody, Goal: I am currently trying to create a command button in Excel that, when one clicks on it, sends out an email to me with an order that one has entered into Excel. The following link here: Using Excel VBA to Send Emails with Attachments - has a nice VBA code that...
  11. H

    Excel VBA Display text box vs. Input text box values fail to transfer with display text box method, Compile error: Method or data member not found

    Hi, I have 2 scenarios where: 1. I have an integrated VBA form where values are input manually in a textbox and I get results outputted successfully. I was able to find an i.e. =embed((m1r1) command in the textbox but can't seem to access it again. The first sheet has code like this...
  12. T

    Run Time Error on Certain Builds Only

    Hello there! I need to disable AutoSave in a certain file when opening. The solution posted here works fine on my machine with Excel 365, however other people have encountered problems. I have Office 365, but others have Office 2016 (both of which are considered Version 16 apparently, albeit...
  13. T

    For without Next

    Hello, I have a custom tab from UI Editor. I keep getting 'For without Next' error and it highlights the End Sub. Have no idea why. Please help! Sub DC_Split(Optional ByVal Control As IRibbonControl) Application.Calculation = xlCalculationManual Application.EnableEvents = False...
  14. M

    How to suppress compile errors generated from ActiveX code being present on MAC

    I have a workbook with code referencing activex objects that isn't supposed to be ran on if the user is on Mac, however after the user gets out of the initial read only mode upon receiving the document, ActiveX objects are deleted. Trying to run certain macros will then result in compile errors...
  15. T

    AutoSaveOn issue with Excel 2013 and 2016

    Sorry if this is in the wrong location, this is the first time I am posting on this forum. My issue is a regarding a "Compile Error: Method or data member not found" that happens when an excel file is opened by some users. These users have either excel 2013 or 2016 installed. The compile error...
  16. M

    Compile Error: cant find library or folder (DATE) in VBA

    I am running a macro in excel and i am having trouble with this error popping up and highlighting the Year(DATE) formula in my vba. i have searched and searched and have found things on how to replace the referrences but i dont know what reference to use to solve this issue. my program runs...
  17. R

    VB Invalid use of property

    I don't know why I keep getting this error. I've tried BeforeUpate,AfterUpdate, enter,exit....none of them work. HELP, please Private Sub TextBox2_Exit(ByVal Cancel As MSForms.ReturnBoolean) Dim Username As String Username = TextBox2.Value MsgBox "Hello, " + Username + "...
  18. tlc53

    VBA Code Not Working / Error - Hide rows depending on 2x drop down lists

    Hi there, Before I go back to the drawing board, can anyone see whether they can get this VBA code to work? Basically, I have two drop down lists. One is "No. of Investments" and the other is "No. of Partners". I would like certain rows to hide, depending on the result of both drop down lists...
  19. Y

    Debugging errors for macro on for other users

    I have created a Macro as follows to create a web query and loop through the alphabet to append the data of multiple queries into a worksheet. The macro is connected to a button on one of the worksheets in my Workbook. Issue: I can run it on my computer (Trust Center settings set to Macros -...
  20. B

    Create Temp Copy of Workbook to Email (Ron De Bruin Code) - TempFilePath Environ Issue

    Hi Community, Hoping you can help with an error i'm encountering when running a script to create a temporary copy of the workbook > attach it to email and send using outlook. I get an error on: TempFilePath = Environ$("temp") & "" The exact error message is: "Compile Error Can't Find project...

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
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 "".
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