+ Reply to Thread
Results 1 to 5 of 5

Compile error - I need advice on what wrong please

  1. #1
    Valued Forum Contributor
    Join Date
    06-23-2010
    Location
    North West
    MS-Off Ver
    office 2010
    Posts
    355

    Compile error - I need advice on what wrong please

    Good Morning
    I have attached a sample worksheet which is more or less complete except for one compile error (User defined type not defined)
    I want to be able to email the worksheet to other committee members but I get the compile error. the email button I'm using is on he right hand sheet.
    I use the same code in another workbook and it works perfectly. Unfortunately I haven't a clue what I'm meant to be changing because it all looks alright to me.
    Could someone take a look please and advise what I need to change, its probably obvious but unfortunately not to me.

    Thanks
    Attached Files Attached Files

  2. #2
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,948

    Re: Compile error - I need advice on what wrong please

    In the VB Editor window click on "Tools / References". Scroll down the list and put a tick next to "Microsoft Outlook 14.0 Object Library" then click OK.
    Now test and see if it works as expected.

    BSB

  3. #3
    Valued Forum Contributor
    Join Date
    06-23-2010
    Location
    North West
    MS-Off Ver
    office 2010
    Posts
    355

    Re: Compile error - I need advice on what wrong please

    BadlyspelledBouy. - Thanks very much, that did the did the trick. So simple, but yet so hard when you don't know. Thanks again.
    Last edited by nje; 08-27-2017 at 06:27 AM. Reason: spelling

  4. #4
    Forum Expert BadlySpelledBuoy's Avatar
    Join Date
    06-14-2013
    Location
    East Sussex, UK
    MS-Off Ver
    365
    Posts
    7,948

    Re: Compile error - I need advice on what wrong please

    One of those "only easy when you know where to look" moments I'm afraid.

    Happy to help. Glad you have it sorted now

    Thanks for the rep.

    BSB

  5. #5
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MSO Home and Business 2024
    Posts
    7,351

    Re: Compile error - I need advice on what wrong please

    No need for all those variables or References.

    Please Login or Register  to view this content.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Compile Error: Wrong number of arguments or invalid property assignment Error
    By JJFletcher in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-22-2016, 05:29 PM
  2. [SOLVED] Excel VBA Compile Error wrong number of arguments
    By gjwilson1216 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-24-2013, 03:08 PM
  3. [SOLVED] What is wrong with this code? Compile error etc
    By ExcelFailure in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-30-2013, 08:18 AM
  4. [SOLVED] VBA - Compile Error - Wrong number of arguments
    By Janto724 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 06-28-2013, 06:04 AM
  5. Compile Error - Wrong number of arguments
    By freebird_wr in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-25-2013, 09:34 AM
  6. Replies: 1
    Last Post: 02-17-2006, 12:10 PM
  7. Compile Error - Wrong number of arguements or invalid property ***
    By James T in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-18-2005, 03:50 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1