+ Reply to Thread
Results 1 to 8 of 8

[SOLVED] runtime error "424", object required

  1. #1
    Registered User
    Join Date
    07-27-2012
    Location
    Athens, Greece
    MS-Off Ver
    Excel 2000
    Posts
    11

    [SOLVED] runtime error "424", object required

    Hi all,
    I'm facing a strange problem.
    I'm using the following code to insert a picture in a worksheet and although it works fine in any new workbook I create
    when I try to use it in the one that i need it I get a runtime error "424", object required, message. (Excel 2000)
    Can anyone help please ?

    Please Login or Register  to view this content.
    Last edited by danndiamond; 07-30-2012 at 02:07 PM. Reason: Added code tags

  2. #2
    Valued Forum Contributor smuzoen's Avatar
    Join Date
    10-28-2011
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2003/2007/2010
    Posts
    610

    Re: runtime error "424", object required

    Welcome to Excel Forum - please read our forum rules - when posting code make sure you enclose your code with code tags - see our rules at http://www.excelforum.com/forum-rule...rum-rules.html
    The error I assume is occurring at (i.e. the line being highlighted in the VB Editor)
    Please Login or Register  to view this content.
    ->This is the line being highlighted I assume? You will get an error if you hit cancel when browsing for an image and select Cancel? Change the code to include the variable pic being dimensioned as an object
    Please Login or Register  to view this content.
    If you do not declare the variable pic as an object then you will get Run Time error 424. A good reason to use Option Explicit to make sure that all variables get dimesioned
    Last edited by smuzoen; 07-28-2012 at 12:14 PM.
    Hope this helps.
    Anthony
    Pack my box with five dozen liquor jugs
    PS: Remember to mark your questions as Solved once you are satisfied. Please rate the answer(s) by selecting the Star in the lower left next to the Triangle. It is appreciated?

  3. #3
    Registered User
    Join Date
    07-27-2012
    Location
    Athens, Greece
    MS-Off Ver
    Excel 2000
    Posts
    11

    Re: runtime error "424", object required

    Thanks smuzoen.
    I tried your suggestion and although I'm not getting an error message, I'm not having the pic inserted either.
    And what I still don't understand is why the same sub works in some workbooks and not in others.
    Thanks for your time anyway.

  4. #4
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: runtime error "424", object required

    @ danndiamond

    Welcome to the forum.

    Please notice that code tags have been added to your post(s). The forum rules require them so please keep that in mind and add them yourself whenever showing code in any of your future posts. To see instructions for applying them, click on the Forum Rules button at top of the page and read Rule #3.
    Thanks.

    The fact that you ignored smuzoen's request to use code tags is also against the rules. I urge you to become familiar with the rules in order to avoid any further errors.

  5. #5
    Registered User
    Join Date
    07-27-2012
    Location
    Athens, Greece
    MS-Off Ver
    Excel 2000
    Posts
    11

    Re: runtime error "424", object required

    Thanks for pointing out my error cutter. I'll make sure I don't repeat it.
    Anyway, I solved my problem by using some other code.

  6. #6
    Valued Forum Contributor smuzoen's Avatar
    Join Date
    10-28-2011
    Location
    Brisbane, Australia
    MS-Off Ver
    Excel 2003/2007/2010
    Posts
    610

    Re: runtime error "424", object required

    The reason your picture was not showing was in the top calculation - if you step through the code the picture is imported however the top calculation was the cause of the issue. Anyway well done for finding a solution. To help others would you upload the solution you found.

  7. #7
    Forum Expert Cutter's Avatar
    Join Date
    05-24-2004
    Location
    Ontario,Canada
    MS-Off Ver
    Excel 2010
    Posts
    6,451

    Re: runtime error "424", object required

    @ danndiamond

    Based on your last post it seems that you have resolved your issue but you haven't marked your thread as SOLVED. I'll do that for you now but please keep in mind for your future threads that Rule #9 requires you to do that yourself. As smuzoen says, you should post the code that solved your issue so that others coming across this thread may benefit from it.
    Thanks.

    Also, as a new member of the forum, you may not be aware that you can thank those who have helped you by clicking the small star icon located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

  8. #8
    Registered User
    Join Date
    07-27-2012
    Location
    Athens, Greece
    MS-Off Ver
    Excel 2000
    Posts
    11

    Re: runtime error "424", object required

    As I mentioned before i did come across some code that seems to work well, so this is it :
    Please Login or Register  to view this content.
    Last edited by danndiamond; 07-30-2012 at 02:09 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