Can I link images using a relative path?











up vote
2
down vote

favorite












I am working on an MS Excel workbook that contains around 200 images. They are currently saved within the workbook, so the file becomes huge and working gets very slow.



Linking the pictures without saving them works very well -- I now have the Excel document and a folder "pictures" next to it that contains all my image files.



However, when I move the document and the folder to a new location, all my pictures disappear. This seems to be because Excel saves the link information as absolute paths. (Update: Actually, according to this thread, Excel stores the link information as relative paths as well. Now I really don't know why my links break down..)



Is there a convenient way to save them as relative paths or have Excel automatically update the path information?



Update: It's important that the images get displayed on the sheet and can be printed.



I am working with Microsoft Excel for Mac 2008 and 2011.
I really appreciate your help.










share|improve this question















migrated from stackoverflow.com Jun 25 '13 at 11:00


This question came from our site for professional and enthusiast programmers.















  • Please do a bit of research before posting: See here and here for answers.
    – zx8754
    Jun 25 '13 at 8:20










  • I did read about this and tried it out yesterday. The problem is that when I add a hyperlink to an image file instead of an image file as a link, the image won't get displayed in my Excel sheet. I need to be able to view the images in my sheet and print them.
    – Port Islander 2009
    Jun 25 '13 at 8:31










  • Related: superuser.com/q/876356/234848
    – Hugh
    Feb 23 at 10:16















up vote
2
down vote

favorite












I am working on an MS Excel workbook that contains around 200 images. They are currently saved within the workbook, so the file becomes huge and working gets very slow.



Linking the pictures without saving them works very well -- I now have the Excel document and a folder "pictures" next to it that contains all my image files.



However, when I move the document and the folder to a new location, all my pictures disappear. This seems to be because Excel saves the link information as absolute paths. (Update: Actually, according to this thread, Excel stores the link information as relative paths as well. Now I really don't know why my links break down..)



Is there a convenient way to save them as relative paths or have Excel automatically update the path information?



Update: It's important that the images get displayed on the sheet and can be printed.



I am working with Microsoft Excel for Mac 2008 and 2011.
I really appreciate your help.










share|improve this question















migrated from stackoverflow.com Jun 25 '13 at 11:00


This question came from our site for professional and enthusiast programmers.















  • Please do a bit of research before posting: See here and here for answers.
    – zx8754
    Jun 25 '13 at 8:20










  • I did read about this and tried it out yesterday. The problem is that when I add a hyperlink to an image file instead of an image file as a link, the image won't get displayed in my Excel sheet. I need to be able to view the images in my sheet and print them.
    – Port Islander 2009
    Jun 25 '13 at 8:31










  • Related: superuser.com/q/876356/234848
    – Hugh
    Feb 23 at 10:16













up vote
2
down vote

favorite









up vote
2
down vote

favorite











I am working on an MS Excel workbook that contains around 200 images. They are currently saved within the workbook, so the file becomes huge and working gets very slow.



Linking the pictures without saving them works very well -- I now have the Excel document and a folder "pictures" next to it that contains all my image files.



However, when I move the document and the folder to a new location, all my pictures disappear. This seems to be because Excel saves the link information as absolute paths. (Update: Actually, according to this thread, Excel stores the link information as relative paths as well. Now I really don't know why my links break down..)



Is there a convenient way to save them as relative paths or have Excel automatically update the path information?



Update: It's important that the images get displayed on the sheet and can be printed.



I am working with Microsoft Excel for Mac 2008 and 2011.
I really appreciate your help.










share|improve this question















I am working on an MS Excel workbook that contains around 200 images. They are currently saved within the workbook, so the file becomes huge and working gets very slow.



Linking the pictures without saving them works very well -- I now have the Excel document and a folder "pictures" next to it that contains all my image files.



However, when I move the document and the folder to a new location, all my pictures disappear. This seems to be because Excel saves the link information as absolute paths. (Update: Actually, according to this thread, Excel stores the link information as relative paths as well. Now I really don't know why my links break down..)



Is there a convenient way to save them as relative paths or have Excel automatically update the path information?



Update: It's important that the images get displayed on the sheet and can be printed.



I am working with Microsoft Excel for Mac 2008 and 2011.
I really appreciate your help.







microsoft-excel microsoft-excel-2011 microsoft-excel-2008






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 20 '17 at 10:17









Community

1




1










asked Jun 25 '13 at 7:50









Port Islander 2009

1113




1113




migrated from stackoverflow.com Jun 25 '13 at 11:00


This question came from our site for professional and enthusiast programmers.






migrated from stackoverflow.com Jun 25 '13 at 11:00


This question came from our site for professional and enthusiast programmers.














  • Please do a bit of research before posting: See here and here for answers.
    – zx8754
    Jun 25 '13 at 8:20










  • I did read about this and tried it out yesterday. The problem is that when I add a hyperlink to an image file instead of an image file as a link, the image won't get displayed in my Excel sheet. I need to be able to view the images in my sheet and print them.
    – Port Islander 2009
    Jun 25 '13 at 8:31










  • Related: superuser.com/q/876356/234848
    – Hugh
    Feb 23 at 10:16


















  • Please do a bit of research before posting: See here and here for answers.
    – zx8754
    Jun 25 '13 at 8:20










  • I did read about this and tried it out yesterday. The problem is that when I add a hyperlink to an image file instead of an image file as a link, the image won't get displayed in my Excel sheet. I need to be able to view the images in my sheet and print them.
    – Port Islander 2009
    Jun 25 '13 at 8:31










  • Related: superuser.com/q/876356/234848
    – Hugh
    Feb 23 at 10:16
















Please do a bit of research before posting: See here and here for answers.
– zx8754
Jun 25 '13 at 8:20




Please do a bit of research before posting: See here and here for answers.
– zx8754
Jun 25 '13 at 8:20












I did read about this and tried it out yesterday. The problem is that when I add a hyperlink to an image file instead of an image file as a link, the image won't get displayed in my Excel sheet. I need to be able to view the images in my sheet and print them.
– Port Islander 2009
Jun 25 '13 at 8:31




I did read about this and tried it out yesterday. The problem is that when I add a hyperlink to an image file instead of an image file as a link, the image won't get displayed in my Excel sheet. I need to be able to view the images in my sheet and print them.
– Port Islander 2009
Jun 25 '13 at 8:31












Related: superuser.com/q/876356/234848
– Hugh
Feb 23 at 10:16




Related: superuser.com/q/876356/234848
– Hugh
Feb 23 at 10:16










2 Answers
2






active

oldest

votes

















up vote
0
down vote













You have 2 basic questions here, rendering images in Excel, and relative paths.



Rendering Images in Excel



There's a script to accomplish this on SO:



Dim url_column As Range
Dim image_column As Range

Set url_column = Worksheets(1).UsedRange.Columns("A")
Set image_column = Worksheets(1).UsedRange.Columns("B")

Dim i As Long
For i = 1 To url_column.Cells.Count

With image_column.Worksheet.Pictures.Insert(url_column.Cells(i).Value)
.Left = image_column.Cells(i).Left
.Top = image_column.Cells(i).Top
image_column.Cells(i).EntireRow.RowHeight = .Height
End With

Next


Relative Paths



I don't know of a way to specify relative paths in an Excel doc, but there's an easy workaround for this. Create a folder for you Excel doc and all of the supporting images, and keep them together. If you need to move this to another location, you just move the whole folder. This also makes it easy to zip up & send to others.






share|improve this answer























  • Thank you for your reply. Your suggestion for the relative path issue would be great, but this is exactly what I can't get to work. I read on SO that linked files are actually saved relatively as well (superuser.com/questions/394270/…), but whenever I move or rename the whole folder with excel doc and images, the links are all broken. What am I doing wrong?
    – Port Islander 2009
    Jun 27 '13 at 9:25


















up vote
0
down vote













Use the Find/Replace feature in Excel to update the path of your image file. I moved my files from /Desktop to /Dropbox. I replaced "desktop" with "dropbox" and within seconds, all my image paths updated. :)






share|improve this answer





















    Your Answer








    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "3"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f611750%2fcan-i-link-images-using-a-relative-path%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    You have 2 basic questions here, rendering images in Excel, and relative paths.



    Rendering Images in Excel



    There's a script to accomplish this on SO:



    Dim url_column As Range
    Dim image_column As Range

    Set url_column = Worksheets(1).UsedRange.Columns("A")
    Set image_column = Worksheets(1).UsedRange.Columns("B")

    Dim i As Long
    For i = 1 To url_column.Cells.Count

    With image_column.Worksheet.Pictures.Insert(url_column.Cells(i).Value)
    .Left = image_column.Cells(i).Left
    .Top = image_column.Cells(i).Top
    image_column.Cells(i).EntireRow.RowHeight = .Height
    End With

    Next


    Relative Paths



    I don't know of a way to specify relative paths in an Excel doc, but there's an easy workaround for this. Create a folder for you Excel doc and all of the supporting images, and keep them together. If you need to move this to another location, you just move the whole folder. This also makes it easy to zip up & send to others.






    share|improve this answer























    • Thank you for your reply. Your suggestion for the relative path issue would be great, but this is exactly what I can't get to work. I read on SO that linked files are actually saved relatively as well (superuser.com/questions/394270/…), but whenever I move or rename the whole folder with excel doc and images, the links are all broken. What am I doing wrong?
      – Port Islander 2009
      Jun 27 '13 at 9:25















    up vote
    0
    down vote













    You have 2 basic questions here, rendering images in Excel, and relative paths.



    Rendering Images in Excel



    There's a script to accomplish this on SO:



    Dim url_column As Range
    Dim image_column As Range

    Set url_column = Worksheets(1).UsedRange.Columns("A")
    Set image_column = Worksheets(1).UsedRange.Columns("B")

    Dim i As Long
    For i = 1 To url_column.Cells.Count

    With image_column.Worksheet.Pictures.Insert(url_column.Cells(i).Value)
    .Left = image_column.Cells(i).Left
    .Top = image_column.Cells(i).Top
    image_column.Cells(i).EntireRow.RowHeight = .Height
    End With

    Next


    Relative Paths



    I don't know of a way to specify relative paths in an Excel doc, but there's an easy workaround for this. Create a folder for you Excel doc and all of the supporting images, and keep them together. If you need to move this to another location, you just move the whole folder. This also makes it easy to zip up & send to others.






    share|improve this answer























    • Thank you for your reply. Your suggestion for the relative path issue would be great, but this is exactly what I can't get to work. I read on SO that linked files are actually saved relatively as well (superuser.com/questions/394270/…), but whenever I move or rename the whole folder with excel doc and images, the links are all broken. What am I doing wrong?
      – Port Islander 2009
      Jun 27 '13 at 9:25













    up vote
    0
    down vote










    up vote
    0
    down vote









    You have 2 basic questions here, rendering images in Excel, and relative paths.



    Rendering Images in Excel



    There's a script to accomplish this on SO:



    Dim url_column As Range
    Dim image_column As Range

    Set url_column = Worksheets(1).UsedRange.Columns("A")
    Set image_column = Worksheets(1).UsedRange.Columns("B")

    Dim i As Long
    For i = 1 To url_column.Cells.Count

    With image_column.Worksheet.Pictures.Insert(url_column.Cells(i).Value)
    .Left = image_column.Cells(i).Left
    .Top = image_column.Cells(i).Top
    image_column.Cells(i).EntireRow.RowHeight = .Height
    End With

    Next


    Relative Paths



    I don't know of a way to specify relative paths in an Excel doc, but there's an easy workaround for this. Create a folder for you Excel doc and all of the supporting images, and keep them together. If you need to move this to another location, you just move the whole folder. This also makes it easy to zip up & send to others.






    share|improve this answer














    You have 2 basic questions here, rendering images in Excel, and relative paths.



    Rendering Images in Excel



    There's a script to accomplish this on SO:



    Dim url_column As Range
    Dim image_column As Range

    Set url_column = Worksheets(1).UsedRange.Columns("A")
    Set image_column = Worksheets(1).UsedRange.Columns("B")

    Dim i As Long
    For i = 1 To url_column.Cells.Count

    With image_column.Worksheet.Pictures.Insert(url_column.Cells(i).Value)
    .Left = image_column.Cells(i).Left
    .Top = image_column.Cells(i).Top
    image_column.Cells(i).EntireRow.RowHeight = .Height
    End With

    Next


    Relative Paths



    I don't know of a way to specify relative paths in an Excel doc, but there's an easy workaround for this. Create a folder for you Excel doc and all of the supporting images, and keep them together. If you need to move this to another location, you just move the whole folder. This also makes it easy to zip up & send to others.







    share|improve this answer














    share|improve this answer



    share|improve this answer








    edited May 23 '17 at 12:41









    Community

    1




    1










    answered Jun 26 '13 at 18:48









    Lenwood

    20317




    20317












    • Thank you for your reply. Your suggestion for the relative path issue would be great, but this is exactly what I can't get to work. I read on SO that linked files are actually saved relatively as well (superuser.com/questions/394270/…), but whenever I move or rename the whole folder with excel doc and images, the links are all broken. What am I doing wrong?
      – Port Islander 2009
      Jun 27 '13 at 9:25


















    • Thank you for your reply. Your suggestion for the relative path issue would be great, but this is exactly what I can't get to work. I read on SO that linked files are actually saved relatively as well (superuser.com/questions/394270/…), but whenever I move or rename the whole folder with excel doc and images, the links are all broken. What am I doing wrong?
      – Port Islander 2009
      Jun 27 '13 at 9:25
















    Thank you for your reply. Your suggestion for the relative path issue would be great, but this is exactly what I can't get to work. I read on SO that linked files are actually saved relatively as well (superuser.com/questions/394270/…), but whenever I move or rename the whole folder with excel doc and images, the links are all broken. What am I doing wrong?
    – Port Islander 2009
    Jun 27 '13 at 9:25




    Thank you for your reply. Your suggestion for the relative path issue would be great, but this is exactly what I can't get to work. I read on SO that linked files are actually saved relatively as well (superuser.com/questions/394270/…), but whenever I move or rename the whole folder with excel doc and images, the links are all broken. What am I doing wrong?
    – Port Islander 2009
    Jun 27 '13 at 9:25












    up vote
    0
    down vote













    Use the Find/Replace feature in Excel to update the path of your image file. I moved my files from /Desktop to /Dropbox. I replaced "desktop" with "dropbox" and within seconds, all my image paths updated. :)






    share|improve this answer

























      up vote
      0
      down vote













      Use the Find/Replace feature in Excel to update the path of your image file. I moved my files from /Desktop to /Dropbox. I replaced "desktop" with "dropbox" and within seconds, all my image paths updated. :)






      share|improve this answer























        up vote
        0
        down vote










        up vote
        0
        down vote









        Use the Find/Replace feature in Excel to update the path of your image file. I moved my files from /Desktop to /Dropbox. I replaced "desktop" with "dropbox" and within seconds, all my image paths updated. :)






        share|improve this answer












        Use the Find/Replace feature in Excel to update the path of your image file. I moved my files from /Desktop to /Dropbox. I replaced "desktop" with "dropbox" and within seconds, all my image paths updated. :)







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Dec 20 '13 at 17:24









        user283528

        1




        1






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Super User!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.





            Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


            Please pay close attention to the following guidance:


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f611750%2fcan-i-link-images-using-a-relative-path%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Probability when a professor distributes a quiz and homework assignment to a class of n students.

            Aardman Animations

            Are they similar matrix