Home

Excel VBA Images

%3CLINGO-SUB%20id%3D%22lingo-sub-961600%22%20slang%3D%22en-US%22%3EExcel%20VBA%20Images%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-961600%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20currently%20have%20a%20macro%20to%20insert%20images%20into%20my%20excel%20sheet%20by%20using%20the%20product%20code%20to%20easily%20produce%20product%20quotes%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHowever%2C%20because%20the%20images%20are%20stored%20locally%2C%20when%20I%20share%20the%20document%20outside%20of%20my%20organisation%2C%20I%20have%20to%20export%20it%20as%20a%20PDF%20to%20ensure%20the%20images%20are%20visible%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%26nbsp%3Bthink%20I%20need%20to%20change%20the%20macro%20to%20shapes%2Fadd%20picture%20method%20to%20embed%20the%20images%20so%20they%20are%20visible%20to%20everyone%20outside%20my%20organisation%20but%20I%20can't%20get%20it%20to%20work%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHere's%20my%20current%20macro%2C%20can%20anyone%20help%3F%20Thank%20you!!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CFONT%20face%3D%22Calibri%22%20color%3D%22%23000000%22%3ESub%20Images()%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20face%3D%22Calibri%22%20color%3D%22%23000000%22%3E'%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20face%3D%22Calibri%22%20color%3D%22%23000000%22%3E'%20Images%20Macro%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20face%3D%22Calibri%22%20color%3D%22%23000000%22%3E'%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20face%3D%22Calibri%22%20color%3D%22%23000000%22%3E%26nbsp%3B%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20face%3D%22Calibri%22%20color%3D%22%23000000%22%3EApplication.ScreenUpdating%20%3D%20False%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20face%3D%22Calibri%22%20color%3D%22%23000000%22%3E%26nbsp%3B%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20face%3D%22Calibri%22%20color%3D%22%23000000%22%3EDim%20fName%20As%20String%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20face%3D%22Calibri%22%20color%3D%22%23000000%22%3E%26nbsp%3B%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20face%3D%22Calibri%22%20color%3D%22%23000000%22%3E%26nbsp%3B%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20face%3D%22Calibri%22%20color%3D%22%23000000%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Range(%22A2%22).Select%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20face%3D%22Calibri%22%20color%3D%22%23000000%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20face%3D%22Calibri%22%20color%3D%22%23000000%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3BOn%20Error%20Resume%20Next%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20face%3D%22Calibri%22%20color%3D%22%23000000%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20face%3D%22Calibri%22%20color%3D%22%23000000%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3BDo%20While%20ActiveCell.Offset(0%2C%203).Value%20%26lt%3B%26gt%3B%20%22%22%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20face%3D%22Calibri%22%20color%3D%22%23000000%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20fName%20%3D%20ActiveCell.Offset(0%2C%203).Value%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20face%3D%22Calibri%22%20color%3D%22%23000000%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%26nbsp%3B%3CFONT%20face%3D%22Calibri%22%20color%3D%22%23000000%22%3EActiveSheet.Pictures.Insert(%22%3C%2FFONT%3E%3CA%20target%3D%22_blank%22%20rel%3D%22noopener%22%3E%5C%5CBARD%5CUKImagebank%24%5C%3C%2FA%3E%3CFONT%20face%3D%22Calibri%22%20color%3D%22%23000000%22%3E%22%20%26amp%3B%20fName).Select%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20face%3D%22Calibri%22%20color%3D%22%23000000%22%3E%26nbsp%3B%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20face%3D%22Calibri%22%20color%3D%22%23000000%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Selection.ShapeRange.ScaleWidth%200.6%2C%20msoFalse%2C%20msoScaleFromTopLeft%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20face%3D%22Calibri%22%20color%3D%22%23000000%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Selection.ShapeRange.ScaleHeight%200.6%2C%20msoFalse%2C%20msoScaleFromTopLeft%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20face%3D%22Calibri%22%20color%3D%22%23000000%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Selection.ShapeRange.IncrementLeft%2014.25%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20face%3D%22Calibri%22%20color%3D%22%23000000%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20Selection.ShapeRange.IncrementTop%206.25%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20face%3D%22Calibri%22%20color%3D%22%23000000%22%3E%26nbsp%3B%26nbsp%3B%26nbsp%3B%20ActiveCell.Offset(1%2C%200).Select%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20face%3D%22Calibri%22%20color%3D%22%23000000%22%3ELoop%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20face%3D%22Calibri%22%20color%3D%22%23000000%22%3E%26nbsp%3B%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20face%3D%22Calibri%22%20color%3D%22%23000000%22%3EApplication.ScreenUpdating%20%3D%20True%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20face%3D%22Calibri%22%20color%3D%22%23000000%22%3E%26nbsp%3B%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20face%3D%22Calibri%22%20color%3D%22%23000000%22%3E%26nbsp%3B%3C%2FFONT%3E%3C%2FP%3E%3CP%3E%3CFONT%20face%3D%22Calibri%22%20color%3D%22%23000000%22%3EEnd%20Sub%3C%2FFONT%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-961600%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMacros%20and%20VBA%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Highlighted
HelenClinton
Visitor

Hi,

 

I currently have a macro to insert images into my excel sheet by using the product code to easily produce product quotes

 

However, because the images are stored locally, when I share the document outside of my organisation, I have to export it as a PDF to ensure the images are visible

 

I think I need to change the macro to shapes/add picture method to embed the images so they are visible to everyone outside my organisation but I can't get it to work

 

Here's my current macro, can anyone help? Thank you!!

 

Sub Images()

'

' Images Macro

'

 

Application.ScreenUpdating = False

 

Dim fName As String

 

 

    Range("A2").Select

   

    On Error Resume Next

   

    Do While ActiveCell.Offset(0, 3).Value <> ""

    fName = ActiveCell.Offset(0, 3).Value

   

    ActiveSheet.Pictures.Insert("\\BARD\UKImagebank$\" & fName).Select

 

    Selection.ShapeRange.ScaleWidth 0.6, msoFalse, msoScaleFromTopLeft

    Selection.ShapeRange.ScaleHeight 0.6, msoFalse, msoScaleFromTopLeft

    Selection.ShapeRange.IncrementLeft 14.25

    Selection.ShapeRange.IncrementTop 6.25

    ActiveCell.Offset(1, 0).Select

Loop

 

Application.ScreenUpdating = True

 

 

End Sub

Related Conversations
vba sending email w/ attachment
katrina bethea in Excel on
7 Replies
Need some help with my Vlookup or a new idee
Jim Brastad in Excel on
5 Replies
SharePoint Picture Library Stopped Showing Photos
smithme in SharePoint on
1 Replies
VBA - Splitting worksheet by Dept
Zia Siddique in Excel on
12 Replies
Excel on MacOS using VBA to create a button
Rick Argiro in Excel on
1 Replies