+ Reply to Thread
Results 1 to 9 of 9

Insert Pictures problem with macro

  1. #1
    Registered User
    Join Date
    01-09-2013
    Location
    london, england
    MS-Off Ver
    Excel 2010
    Posts
    8

    Insert Pictures problem with macro

    Hi Folks,

    I use a macro to import pictures from a folder, but is not working perfectly.
    If you check, this macro (see txt attachment) insert pictures in a sheet and create "footers" above the picture with texts.
    Somehow the pictures insert points moving down slowly, and I can see growing difference between the "footer" and the picture (after 10 pictures is around 1/8 cell size....)
    Do you have any idea how can I fix it? (my row height is default: 12.75)

    Thanks,

    encleadus
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,844

    Re: Insert Pictures problem with macro

    Check out how to post code here: http://www.excelforum.com/forum-rule...rum-rules.html
    <----- If you were helped by my posts you can say "Thank you" by clicking the star symbol down to the left

    If the problem is solved, finish of the thread by clicking SOLVED under Thread Tools
    I don't wish to leave you with no answer, yet I sometimes miss posts. If you feel I forgot you, remind me with a PM or just bump the thread.

  3. #3
    Registered User
    Join Date
    01-09-2013
    Location
    london, england
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Insert Pictures problem with macro

    Sorry,
    here is my code:
    Please Login or Register  to view this content.

  4. #4
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,844

    Re: Insert Pictures problem with macro

    Excellent! I'm having a look now.

  5. #5
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,844

    Re: Insert Pictures problem with macro

    I took the freedom to mess around quite a bit with your code and made some modifications to make it run faster.
    I think this does what you want.
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    01-09-2013
    Location
    london, england
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Insert Pictures problem with macro

    Thank you very much, it's worked perfectly!
    Could you tell what what was the problem with my code? Why changed the difference between the merged cells and the inserted pictures?

    encleadus

  7. #7
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,844

    Re: Insert Pictures problem with macro

    Here is a slight improvement, a basic errorhandling. If you specify more files than are available it just exits with no drama.

    Please Login or Register  to view this content.

  8. #8
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,844

    Re: Insert Pictures problem with macro

    Good to hear it worked!
    I don't know for sure what was wrong with your code, I think maybe Excel has a problem with decimal numbers in row heights.
    That's why I skipped that and referenced the position to the closest header cell instead.

  9. #9
    Forum Expert
    Join Date
    09-01-2012
    Location
    Norway
    MS-Off Ver
    Office 365
    Posts
    2,844

    Re: Insert Pictures problem with macro

    I didn't need different names for the ranges in the end. Forgot to clean that up.
    Please Login or Register  to view this content.

+ 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