+ Reply to Thread
Results 1 to 5 of 5

"Type mismatch"-error with a short test-version of mail macro

  1. #1
    Registered User
    Join Date
    02-03-2010
    Location
    Rotterdam
    MS-Off Ver
    Excel 2003
    Posts
    12

    Question "Type mismatch"-error with a short test-version of mail macro

    Hi all,

    I have made a mail macro for my work, but my collegues would like to see a short testversion of the macro, to see that it gets up all the good information from my sheet and that there are not too few/to many spaces. My intention is to create a macro that opens two "new e-mail" screens in Outlook, with one Dutch and one English version of the mail. But when I run the test version, it says "type mismatch". What am I doing wrong? Below my mail macro and my test version. Thanks.

    Full mail macro
    Please Login or Register  to view this content.

    Test version
    Please Login or Register  to view this content.
    Last edited by JohannesEngelbert; 02-14-2010 at 10:14 AM. Reason: Marked the line where it says "type mismatch"

  2. #2
    Forum Expert martindwilson's Avatar
    Join Date
    06-23-2007
    Location
    London,England
    MS-Off Ver
    office 97 ,2007
    Posts
    19,320

    Re: "Type mismatch"-error with a short test-version of mail macro

    im not sure but i think
    Dim cl As Range
    is needed then again that may be gibberish
    Last edited by martindwilson; 02-14-2010 at 10:35 AM.
    "Unless otherwise stated all my comments are directed at OP"

    Mojito connoisseur and now happily retired
    where does code go ?
    look here
    how to insert code

    how to enter array formula

    why use -- in sumproduct
    recommended reading
    wiki Mojito

    how to say no convincingly

    most important thing you need
    Martin Wilson: SPV
    and RSMBC

  3. #3
    Registered User
    Join Date
    02-03-2010
    Location
    Rotterdam
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: "Type mismatch"-error with a short test-version of mail macro

    I've added it to the code, but it keeps saying "type mismatch".

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: "Type mismatch"-error with a short test-version of mail macro

    A few pointers perhaps:

    Please Login or Register  to view this content.

    and

    Please Login or Register  to view this content.

    or

    Please Login or Register  to view this content.

    You should also look to restrict the range you're looping to include only those cells necessary... as is you're going to iterate every cell in Column E...

    Explicitly Declaring variables (as outlined by Martin) is good practice if not always required.

  5. #5
    Registered User
    Join Date
    02-03-2010
    Location
    Rotterdam
    MS-Off Ver
    Excel 2003
    Posts
    12

    Re: "Type mismatch"-error with a short test-version of mail macro

    Thanks, the macro runs now, but not correct. He opens a new e-mail for all the adresses in column E, but in every mail the body is only "contactperson", he skips the rest of the mail.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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