+ Reply to Thread
Results 1 to 11 of 11

run-time error '13' Type Mismatch error

  1. #1
    Valued Forum Contributor Blake 7's Avatar
    Join Date
    10-01-2010
    Location
    Bogota, Colombia
    MS-Off Ver
    Excel 2010 64 bit and Excel 2007,
    Posts
    1,377

    run-time error '13' Type Mismatch error

    Dear community,

    I am trying to use the macro below to place a picture, however, I am receiving the error;

    run-time error '13' Type mismatch.

    The de-bug is highlighting the line "For Each oPic In Me.Pictures"

    has anyone seen this before or is able to help resolve this issue?

    many thanks

    Please Login or Register  to view this content.
    ption Explicit
    Last edited by Blake 7; 08-16-2012 at 08:59 AM.
    Blake 7

    If your question has been answered, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

    If any member's response has helped to solve your problem, please consider using the scales icon on the top right of their post to show your appreciation.

    http://failblog.org/

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,437

    Re: run-time error '13' Type Mismatch error

    Code works for me.

    Given the routine is an event I assume the code is within a sheet object?
    Cheers
    Andy
    www.andypope.info

  3. #3
    Valued Forum Contributor Blake 7's Avatar
    Join Date
    10-01-2010
    Location
    Bogota, Colombia
    MS-Off Ver
    Excel 2010 64 bit and Excel 2007,
    Posts
    1,377

    Re: run-time error '13' Type Mismatch error

    Andy, how's it going dude? hope all well with you and that you are enjoying the summer. Eek what summer!

    the code tis indeed placed in sheet 12 where i want the action to happen.... im stumped!

    any more clues?

  4. #4
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,437

    Re: run-time error '13' Type Mismatch error

    It's going well thanks!
    Longs as it shines when I do get a break I don't care.

    Can you post an example to illustrate the problem. Nothing wrong with the code.

  5. #5
    Valued Forum Contributor Blake 7's Avatar
    Join Date
    10-01-2010
    Location
    Bogota, Colombia
    MS-Off Ver
    Excel 2010 64 bit and Excel 2007,
    Posts
    1,377

    Re: run-time error '13' Type Mismatch error

    Hiya - when are you taking your break? going anywhere nice? we just got back from Roundhill Campsite in the New Forest nr Brockenhurst.

    The weather was terrific. We took a tent and grandma and grandad took their caravan. The children loved it although it's pretty hard work trying to get them washed or taking them for a pee in the middle of the night! Anyway. it was a break and i'm now an expert with a frizby!

    The worknook is about 4mb as its part of a dashboard. Can i send it to your email?

  6. #6
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,437

    Re: run-time error '13' Type Mismatch error

    You can send to email.
    But could you not just save sheet12 to a new workbook? Code and stuff in/on the worksheet should also copy.

    I had a day off in July, which was nice. A trip to Natural History Museum and a wonder around westend shops.

  7. #7
    Valued Forum Contributor Blake 7's Avatar
    Join Date
    10-01-2010
    Location
    Bogota, Colombia
    MS-Off Ver
    Excel 2010 64 bit and Excel 2007,
    Posts
    1,377

    Re: run-time error '13' Type Mismatch error

    i'll send the workbook as a whole becase when i use the code in a new workbook it works fine!! i'll send it over now.

  8. #8
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,437

    Re: run-time error '13' Type Mismatch error

    This revision will fix the problem.

    Please Login or Register  to view this content.
    Looks like the activex command button is included in the Pictures collection. But when you try to reference it fails as it's not a Picture object

  9. #9
    Valued Forum Contributor Blake 7's Avatar
    Join Date
    10-01-2010
    Location
    Bogota, Colombia
    MS-Off Ver
    Excel 2010 64 bit and Excel 2007,
    Posts
    1,377

    Re: run-time error '13' Type Mismatch error

    Hey Andy - i'll give this a shot now and report back. How did you find out that the activex cmd button is included in the pics?

    Cheers

  10. #10
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,437

    Re: run-time error '13' Type Mismatch error

    I added some Debug.Print statements to the code in order to tell me name and numbers of items in collection.

    Doing that also allowed me to tell that you have multiple pictures with the same name, which may cause confusion later if the incorrect picture appears for the correct name provided.

  11. #11
    Valued Forum Contributor Blake 7's Avatar
    Join Date
    10-01-2010
    Location
    Bogota, Colombia
    MS-Off Ver
    Excel 2010 64 bit and Excel 2007,
    Posts
    1,377

    Re: run-time error '13' Type Mismatch error

    Many thanks Andy you have been a super help. I Excel were an Olympic sport, you'd be on that podium.
    Last edited by Cutter; 08-16-2012 at 07:41 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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