+ Reply to Thread
Results 1 to 3 of 3

VBA Export file to xlsx with embedded images

  1. #1
    Registered User
    Join Date
    11-16-2020
    Location
    POLAND
    MS-Off Ver
    Office 365
    Posts
    1

    VBA Export file to xlsx with embedded images

    HELLO !

    I would like export the file to xlsx with embedded photos directly in the file. At this point, the file is exported to xlsx but when i open this file in another pc ,photos are not displayed.




    The current code responsible for export to xlsx:

    Please Login or Register  to view this content.

    FULL CODE which is designed to pair the table rows with photos ( they are in local folder). Working OK:

    Please Login or Register  to view this content.
    THX for HELP !!

  2. #2
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,519

    Re: VBA Export file to xlsx with embedded images

    Use "AddPicture" instead of "Insert"
    From VBA Help:
    Excel Developer Reference
    Shapes.AddPicture Method
    Creates a picture from an existing file. Returns a Shape object that represents the new picture.

    expression.AddPicture(Filename, LinkToFile, SaveWithDocument, Left, Top, Width, Height)
    expression A variable that represents a Shapes object.
    Parameters
    Name Required/Optional Data Type Description
    Filename Required String The file from which the OLE object is to be created.
    LinkToFile Required MsoTriState The file to link to.
    SaveWithDocument Required MsoTriState To save the picture with the document.
    Left Required Single The position (in points) of the upper-left corner of the picture relative to the upper-left corner of the document.
    Top Required Single The position (in points) of the upper-left corner of the picture relative to the top of the document.
    Width Required Single The width of the picture, in points.
    Height Required Single The height of the picture, in points.

    You'll end up with something like this (Change references as required):
    Please Login or Register  to view this content.

  3. #3
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,519

    Re: VBA Export file to xlsx with embedded images

    https://www.ozgrid.com/forum/index.p...without-links/

+ 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. modify code to export xlsx file with pdf
    By mazan2010 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-06-2021, 02:27 PM
  2. [SOLVED] Export Excel xlsx to delimeted csv file - diffing tool on git
    By jaryszek in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 03-21-2019, 05:39 AM
  3. [SOLVED] Export specific rows of spreadsheet to new .xlsx file
    By Pojzon in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-21-2018, 09:56 PM
  4. Replies: 1
    Last Post: 04-13-2016, 08:46 AM
  5. Bloated workbook file + Embedded images?
    By mc84excel in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-22-2014, 08:09 PM
  6. Questions about file size & Embedded Images
    By topaz99 in forum Excel General
    Replies: 2
    Last Post: 12-04-2013, 08:27 AM
  7. [SOLVED] Extracing embedded images from an XLS file
    By Paul in forum Excel General
    Replies: 2
    Last Post: 01-11-2006, 08:20 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