+ Reply to Thread
Results 1 to 2 of 2

Vba Excel Addpicture code needs to updated Insert not working

  1. #1
    Registered User
    Join Date
    05-22-2011
    Location
    chennai
    MS-Off Ver
    Excel 2003
    Posts
    71

    Vba Excel Addpicture code needs to updated Insert not working

    Hi I have created a code that can insert an image to excel but unfortunately image inserted as link to the image file to the local directory. Below is the complete code and the line that Im stuck is
    Please Login or Register  to view this content.
    And the complete code is
    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 2016 (Windows)
    Posts
    5,060

    Re: Vba Excel Addpicture code needs to updated Insert not working

    If you are selecting multiple files, then the variant array returned needs to by used element by element. What do you get if you look at the variable's current value when it is used?

    Msgbox "Current value is " & sFileToOpen
    Set pic = .Parent.Pictures.Insert(sFileToOpen)



    But try a simplified version:

    Please Login or Register  to view this content.
    Bernie Deitrick
    Excel MVP 2000-2010

+ 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. code not working since updated to 2010
    By Engelr in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-15-2014, 08:06 AM
  2. VBA code to recognize when the excel was updated
    By ezthelm in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-19-2011, 03:37 AM
  3. Working Macro Code to insert random value. Only C48 needs to go to G15 etc.
    By Phixtit in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-26-2009, 06:56 PM
  4. Added a button to insert a row, the code succeeding that is not working
    By Aswathy in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 09-24-2008, 05:20 AM
  5. Code to insert functions not working anymore
    By Mike K in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-22-2006, 09:00 AM
  6. Replies: 1
    Last Post: 03-30-2006, 11:30 AM
  7. [SOLVED] Insert Whole Row in Excel when one column is updated from Access.
    By Gordy w/Hi Expectations in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-19-2005, 10:05 PM

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