VBA help for a Macro (inserting picture from file)

%3CLINGO-SUB%20id%3D%22lingo-sub-189094%22%20slang%3D%22en-US%22%3EVBA%20help%20for%20a%20Macro%20(inserting%20picture%20from%20file)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-189094%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20am%20new%20to%20VBA%20and%20macros%20and%20I%20was%20hoping%20that%20someone%20could%20help%20me%20writing%20the%20VBA%20to%20insert%20a%20photo%20from%20your%20personal%20files.%20I%20created%20the%20button%2C%20but%20I%20just%20need%20to%20write%20the%20VBA%20to%20pull%20up%20the%20users%20files%20so%20they%20can%20select%20the%20photo.%20From%20there%20I%20want%20the%20photo%20to%20be%20placed%20in%20the%20cell%20(you'll%20see%20on%20the%20sheet%20which%20cell%20I%20am%20referring%20to).%20The%20cells%20are%20already%20merged%20together.%20I%20want%20the%20photo%20to%20fit%20in%20the%20cell%20that%20is%20already%20merged.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFor%20some%20reason%20this%20forum%20won't%20let%20me%20upload%20a%20macro%2C%20so%20I%20am%20going%20to%20insert%20the%20excel%20file.%20You'll%20see%20where%20I%20want%20the%20photo's%20on%20the%20%22FLYER%20V1%22%20tab.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks!%20Let%20me%20know%20if%20you%20have%20any%20questions%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-189094%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%20on%20Mac%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMacros%20%26amp%3B%20VBA%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-379580%22%20slang%3D%22en-US%22%3ERe%3A%20VBA%20help%20for%20a%20Macro%20(inserting%20picture%20from%20file)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-379580%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F304789%22%20target%3D%22_blank%22%3E%40dklein_14%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3ETry%20the%20below%20code%20example%20which%20loops%20through%20multiple%20locations%20on%20the%20worksheet.%26nbsp%3B%20I%20have%20commented%20the%20code%20for%20better%20understanding.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EYou%20may%20want%20to%26nbsp%3B%20note%20that%20when%20you%20set%20the%20width%20to%20a%20value%20like%20B3%3AB9%20that%20is%20will%20simple%20make%20the%20image%20the%20length%20of%20the%20B%20column%20or%20similarly%20for%20E9%3AE9%20it%20will%20make%20the%20height%20of%20the%20image%20the%20height%26nbsp%3B%20of%20cell%20E9.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3ESub%20GetPic()%0A%0ADim%20fNameAndPath%20%20%20%20%20As%20Variant%0ADim%20img%20%20%20%20%20%20%20%20%20%20%20%20%20%20As%20Picture%0ADim%20intLp%20%20%20%20%20%20%20%20%20%20%20%20As%20Integer%0ADim%20arrLeftandTop%20%20%20%20As%20Variant%0ADim%20arrWidth%20%20%20%20%20%20%20%20%20As%20Variant%0ADim%20arrHeight%20%20%20%20%20%20%20%20As%20Variant%0A%0AfNameAndPath%20%3D%20Application.GetOpenFilename(Title%3A%3D%22Select%20Picture%20To%20Be%20Imported%22)%20'Open%20FIle%20Dialog%20to%20allow%20user%20to%20pick%20picture%0AIf%20fNameAndPath%20%3D%20False%20Then%20Exit%20Sub%20'If%20the%20user%20cancels%20then%20exit%20the%20procedure....%0A%0A%20%20%20%20'Define%20the%20different%20range%20arrays%0A%20%20%20%20arrLeftandTop%20%3D%20Array(%22B3%22%2C%20%22Q3%22%2C%20%22Q33%22%2C%20%22Q63%22)%20'Left%20and%20top%20range%20values%0A%20%20%20%20arrWidth%20%3D%20Array(%22B3%3AB9%22%2C%20%22Q4%3AQ8%22%2C%20%22Q33%3AQ38%22%2C%20%22Q63%3AQ68%22)%20'Width%20range%20values%0A%20%20%20%20arrHeight%20%3D%20Array(%22E9%3AE9%22%2C%20%22R4%3AR8%22%2C%20%22R33%3AR38%22%2C%20%22R68%3AR68%22)%20'Height%20range%20values%0A%20%20%20%20%0A%20%20%20%20'Loop%20through%20ranges%20and%20place%20pictures%20one%20at%20a%20time....%0A%20%20%20%20'Note%20arrays%20start%20at%200%0A%20%20%20%20'%20arrLeftandTop(0)%20%3D%20%22B3%22%0A%20%20%20%20'%20arrLeftandTop(1)%20%3D%20%22Q3%22%0A%20%20%20%20'.....etc%0A%20%20%20%20For%20intLp%20%3D%200%20To%203%0A%20%20%20%20%0A%20%20%20%20%20%20%20%20Set%20img%20%3D%20ActiveSheet.Pictures.Insert(fNameAndPath)%20'Set%20image%20for%20insert%0A%20%20%20%20%20%20%20%20With%20img%0A%20%20%20%20%20%20%20%20%20%20%20'Resize%20Picture%20to%20fit%20in%20the%20range....%0A%20%20%20%20%20%20%20%20%20%20%20.Left%20%3D%20ActiveSheet.Range(arrLeftandTop(intLp)).Left%0A%20%20%20%20%20%20%20%20%20%20%20.Top%20%3D%20ActiveSheet.Range(arrLeftandTop(intLp)).Top%0A%20%20%20%20%20%20%20%20%20%20%20.Width%20%3D%20ActiveSheet.Range(arrWidth(intLp)).Width%0A%20%20%20%20%20%20%20%20%20%20%20.Height%20%3D%20ActiveSheet.Range(arrHeight(intLp)).Height%0A%20%20%20%20%20%20%20%20%20%20%20.Placement%20%3D%201%0A%20%20%20%20%20%20%20%20%20%20%20.PrintObject%20%3D%20True%0A%20%20%20%20%20%20%20%20End%20With%0A%20%20%20%20%0A%20%20%20%20Next%20intLp%20'Go%20to%20next%20array%20value...%20i.e.%20first%20loop%20is%200%2C%20next%20loop%20is%201....etc.%0A%20%20%20%20%0AEnd%20Sub%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-379251%22%20slang%3D%22en-US%22%3ERe%3A%20VBA%20help%20for%20a%20Macro%20(inserting%20picture%20from%20file)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-379251%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F37127%22%20target%3D%22_blank%22%3E%40Matt%20Mickle%3C%2FA%3E%26nbsp%3Bthe%20locations%20for%20the%206%20other%20images%20are%20as%20follows%3A%3C%2FP%3E%3CPRE%3Eand%20all%20on%20same%20worksheet.%3CBR%20%2F%3E.Left%20%3D%20ActiveSheet.Range(%22q3%22).Left%3CBR%20%2F%3E.Top%20%3D%20ActiveSheet.Range(%22q3%22).Top%3CBR%20%2F%3E.Width%20%3D%20ActiveSheet.Range(%22q4%3Aq8%22).Width%3CBR%20%2F%3E.Height%20%3D%20ActiveSheet.Range(%22r4%3Ar8%22).Height%0A.Placement%20%3D%201%3CBR%20%2F%3E%3CBR%20%2F%3E2%3CBR%20%2F%3E.Left%20%3D%20ActiveSheet.Range(%22q33%22).Left%3CBR%20%2F%3E.Top%20%3D%20ActiveSheet.Range(%22q33%22).Top%3CBR%20%2F%3E.Width%20%3D%20ActiveSheet.Range(%22q33%3Aq38%22).Width%3CBR%20%2F%3E.Height%20%3D%20ActiveSheet.Range(%22r33%3Ar38%22).Height%3CBR%20%2F%3E%3CBR%20%2F%3E3%3CBR%20%2F%3E.Left%20%3D%20ActiveSheet.Range(%22q63%22).Left%3CBR%20%2F%3E.Top%20%3D%20ActiveSheet.Range(%22q63%22).Top%3CBR%20%2F%3E.Width%20%3D%20ActiveSheet.Range(%22q63%3Aq68%22).Width%3CBR%20%2F%3E.Height%20%3D%20ActiveSheet.Range(%22r68%3Ar68%22).Height%3CBR%20%2F%3E%3CBR%20%2F%3EThey%20are%20all%20about%2030%20cell%20spaces%20lower%20and%20I%20have%207%20total.%20%20In%20additional%20I%20have%20a%20sheet%20labeled%20Title%20Page%20and%20there%201%20image%20there%20with%20the%20follow%20location.%3CBR%20%2F%3ETitle%20Page%3CBR%20%2F%3E.Left%20%3D%20ActiveSheet.Range(%22B3%22).Left%3CBR%20%2F%3E.Top%20%3D%20ActiveSheet.Range(%22B3%22).Top%3CBR%20%2F%3E.Width%20%3D%20ActiveSheet.Range(%22B3%3Ab9%22).Width%3CBR%20%2F%3E.Height%20%3D%20ActiveSheet.Range(%22e9%3Ae9%22).Height%3CBR%20%2F%3E%3CBR%20%2F%3EThank%20you%20for%20your%20help!%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-377931%22%20slang%3D%22en-US%22%3ERe%3A%20VBA%20help%20for%20a%20Macro%20(inserting%20picture%20from%20file)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-377931%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSUB%3EHey%20dklein_14-%3C%2FSUB%3E%3C%2FP%3E%0A%3CP%3E%3CSUB%3ECan%20you%20please%20tell%20me%20a%20few%20things%20for%20clarification%3F%3C%2FSUB%3E%3C%2FP%3E%0A%3CP%3E%3CSUB%3EWhat%20are%20the%206%20different%20ranges%3F%26nbsp%3B%20If%20the%20ranges%20are%20on%20different%20worksheets%20can%20you%20further%20clarify%20with%26nbsp%3B%3C%2FSUB%3E%3CSUB%3Eworksheet%20names%3F%3C%2FSUB%3E%3C%2FP%3E%0A%3CP%3E%3CSUB%3E-Matt%3C%2FSUB%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-377918%22%20slang%3D%22en-US%22%3ERe%3A%20VBA%20help%20for%20a%20Macro%20(inserting%20picture%20from%20file)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-377918%22%20slang%3D%22en-US%22%3E%3CP%3EThat%20code%20worked%20perfectly%2C%20my%20question%20is%20I%20have%206%20other%20locations%20to%20place%20the%20same%20image%20how%20can%20I%20do%20so%20for%20the%20other%206%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-190313%22%20slang%3D%22en-US%22%3ERe%3A%20VBA%20help%20for%20a%20Macro%20(inserting%20picture%20from%20file)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-190313%22%20slang%3D%22en-US%22%3E%3CP%3EBrady-%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EJust%20wanted%20to%20follow%20up%20and%20see%20if%20you%20were%20able%20to%20resolve%20your%20issue.%26nbsp%3B%20If%20you're%20still%20having%20trouble%20don't%20hesitate%20to%20reach%20back%20out%20and%20ask%20additional%20inquiries.%26nbsp%3B%20Always%20happy%20to%20help!%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-189134%22%20slang%3D%22en-US%22%3ERe%3A%20VBA%20help%20for%20a%20Macro%20(inserting%20picture%20from%20file)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-189134%22%20slang%3D%22en-US%22%3E%3CP%3EBrady-%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EPlease%20follow%20the%20below%20steps%20to%20accomplish%20your%20task%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E1.%20Open%20the%20Visual%20Basic%20Editor%20(VBE)%20using%20Alt%20%2B%20F11%3C%2FP%3E%0A%3CP%3E2.%20Insert%20%26gt%3B%20Module%3C%2FP%3E%0A%3CP%3E3.%20Paste%20the%20below%20code%20in%20the%20new%20code%20module%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CPRE%3ESub%20GetPic()%0ADim%20fNameAndPath%20As%20Variant%0ADim%20img%20As%20Picture%0AfNameAndPath%20%3D%20Application.GetOpenFilename(Title%3A%3D%22Select%20Picture%20To%20Be%20Imported%22)%0AIf%20fNameAndPath%20%3D%20False%20Then%20Exit%20Sub%0A%20%20%20%20Set%20img%20%3D%20ActiveSheet.Pictures.Insert(fNameAndPath)%0A%20%20%20%20With%20img%0A%20%20%20%20%20%20%20'Resize%20Picture%20to%20fit%20in%20the%20range....%0A%20%20%20%20%20%20%20.Left%20%3D%20ActiveSheet.Range(%22D9%22).Left%0A%20%20%20%20%20%20%20.Top%20%3D%20ActiveSheet.Range(%22D9%22).Top%0A%20%20%20%20%20%20%20.Width%20%3D%20ActiveSheet.Range(%22D9%3AH9%22).Width%0A%20%20%20%20%20%20%20.Height%20%3D%20ActiveSheet.Range(%22D9%3AD28%22).Height%0A%20%20%20%20%20%20%20.Placement%20%3D%201%0A%20%20%20%20%20%20%20.PrintObject%20%3D%20True%0A%20%20%20%20End%20With%0AEnd%20Sub%0A%3C%2FPRE%3E%0A%3CP%3E4.%20Go%20back%20to%20the%20worksheet%3C%2FP%3E%0A%3CP%3E5.%20Right%20Click%20on%20the%20button%20%26gt%3B%20Assign%20Macro%3C%2FP%3E%0A%3CP%3E6.%20Select%20the%20GetPic%20Macro%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EAfter%20following%20these%20steps%20you%20should%20get%20the%20expected%20result.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-911451%22%20slang%3D%22en-US%22%3ERe%3A%20VBA%20help%20for%20a%20Macro%20(inserting%20picture%20from%20file)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-911451%22%20slang%3D%22en-US%22%3E%3CP%3EHello%20Matt%20Mickle%26nbsp%3B%3C%2FP%3E%3CP%3ECan%20you%20help%20me%20on%20this%20Macro%20Please.%20I%20want%20to%20insert%20Picture%20but%20this%20Macro%20is%20not%20working%20in%20my%20MacBook%20maybe%20this%20Macro%20for%20PC%20computer.%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1034487%22%20slang%3D%22en-US%22%3ERe%3A%20VBA%20help%20for%20a%20Macro%20(inserting%20picture%20from%20file)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1034487%22%20slang%3D%22en-US%22%3E%3CP%3EHey%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F37127%22%20target%3D%22_blank%22%3E%40Matt%20Mickle%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'm%20having%20problems%20with%20this%20Macro%20for%20inserting%20photos.%20I%20copied%20it%20from%20a%20PC%20parallel%20to%20use%20on%20my%20Mac%20but%20it's%20keeps%20telling%20me%20the%20file%20doesn't%20exist.%20Can%20you%20help%3F%26nbsp%3B%3C%2FP%3E%3CP%3EI%20uploaded%20a%20test%20file%2C%20the%20other%20one%20is%20a%20much%20larger%20file.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ESub%20InsertAnyPicture()%20Dim%20image%20As%20String%20Columns(%22A%3AB%22).Select%20Selection.Insert%20Shift%3A%3DxlToRight%20Range(%22A2%22).Select%20ActiveCell.FormulaR1C1%20%3D%20_%20%22%3DCONCATENATE(%22%22E%3A%5CUsers%5CTamara%5CDesktop%5CMIASTOCK%20INVENTORY%5Cimages%5C%22%22%2CRC%5B2%5D%2C%22%22.jpeg%22%22)%22%20Application.Goto%20Reference%3A%3D%22OFFSET(R2C1%2C0%2C0%2CCOUNTA(C3)-1%2C1)%22%20Selection.FillDown%20Application.Goto%20Reference%3A%3D%22OFFSET(R2C1%2C0%2C0%2CCOUNTA(C3)-1%2C1)%22%20Set%20InputedRange%20%3D%20Range(Selection.Address)%20For%20Each%20C%20In%20InputedRange%20C.RowHeight%20%3D%2045.5%20image%20%3D%20C.Value%20If%20File_Exists(image)%20%3D%20True%20Then%20Call%20AddPic(image%2C%20C.Offset(0%2C%201))%20Else%20C.Offset(0%2C%201).Value%20%3D%20%22NO%20FILE%22%20End%20If%20If%20C.Value%20%3D%20%22%22%20Then%20Exit%20Sub%20End%20If%20Next%20C%20Range(%22a1%22).Select%20Columns(1).EntireColumn.Delete%20End%20Sub%20Sub%20AddPic(sFile%20As%20String%2C%20r%20As%20Range)%20With%20r.Areas(1)%20ActiveSheet.Shapes.AddPicture%20FileName%3A%3DsFile%2C%20_%20LinkToFile%3A%3DmsoFalse%2C%20_%20SaveWithDocument%3A%3DmsoTrue%2C%20_%20Top%3A%3D.Top%2C%20Left%3A%3D.Left%2C%20_%20Height%3A%3D45%2C%20Width%3A%3D45%20End%20With%20End%20Sub%20Private%20Function%20File_Exists(ByVal%20sPathName%20As%20String%2C%20Optional%20Directory%20As%20Boolean)%20As%20Boolean%20'Returns%20True%20if%20the%20passed%20sPathName%20exist%20'Otherwise%20returns%20False%20On%20Error%20Resume%20Next%20If%20sPathName%20%26lt%3B%26gt%3B%20%22%22%20Then%20If%20IsMissing(Directory)%20Or%20Directory%20%3D%20False%20Then%20File_Exists%20%3D%20(Dir%24(sPathName)%20%26lt%3B%26gt%3B%20%22%22)%20Else%20File_Exists%20%3D%20(Dir%24(sPathName%2C%20vbDirectory)%20%26lt%3B%26gt%3B%20%22%22)%20End%20If%20End%20If%20End%20Function%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1256935%22%20slang%3D%22en-US%22%3ERe%3A%20VBA%20help%20for%20a%20Macro%20(inserting%20picture%20from%20file)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1256935%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F37127%22%20target%3D%22_blank%22%3E%40Matt%20Mickle%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThis%20was%20great!%20is%20there%20a%20way%20to%20allow%20multiple%20uploads%20at%20once%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1376240%22%20slang%3D%22en-US%22%3ERe%3A%20VBA%20help%20for%20a%20Macro%20(inserting%20picture%20from%20file)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1376240%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F37127%22%20target%3D%22_blank%22%3E%40Matt%20Mickle%3C%2FA%3E%26nbsp%3BThis%20is%20great.%20But%20could%20you%20suggest%20how%20I%20could%20embed%20the%20photos%20within%20the%20document%20as%20opposed%20to%20being%20a%20link%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1404672%22%20slang%3D%22en-US%22%3ERe%3A%20VBA%20help%20for%20a%20Macro%20(inserting%20picture%20from%20file)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1404672%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F140848%22%20target%3D%22_blank%22%3E%40brady%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAfter%20using%20the%20VBA%20how%20to%20break%20the%20link%20from%20images.%20As%20the%20file%20is%20shared%20through%20email%20and%20images%20will%20goes%20off%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1558541%22%20slang%3D%22en-US%22%3ERe%3A%20VBA%20help%20for%20a%20Macro%20(inserting%20picture%20from%20file)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1558541%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F37127%22%20target%3D%22_blank%22%3E%40Matt%20Mickle%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EGreat%20tool.%20Do%20you%20know%20if%20there%20is%20away%20instead%20of%20specifying%20the%20exact%20cell%20that%20you%20could%20have%20it%20say%20in%20the%20adjacent%20cell.%20I%20have%20a%20spreadsheet%20that%20I%20would%20like%20to%20use%20this%20Macro%20several%20times%20but%20instead%20of%20having%20multiple%20macros%20each%20specifying%20each%20cell%20can%20I%20make%20it%20dependent%20on%20the%20button%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1558550%22%20slang%3D%22de-DE%22%3ESubject%3A%20VBA%20help%20for%20a%20Macro%20(inserting%20picture%20from%20file)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1558550%22%20slang%3D%22de-DE%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F140848%22%20target%3D%22_blank%22%3E%40brady%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ELook%20the%20File%20please%3C%2FP%3E%3CP%3EIf%20it%20helped%2C%20I%20am%20very%20happy%20...%20please%20mark%20this%20as%20the%20correct%20answer%20so%20that%20others%20are%20informed.%20If%20not%2C%20please%20give%20a%20short%20feedback%2C%20maybe%20the%20other%20helpers%20could%20help%20more%20than%20me.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENikolino%3C%2FP%3E%3CP%3EI%20know%20I%20don't%20know%20anything%20(Socrates)%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1781323%22%20slang%3D%22en-US%22%3ERe%3A%20VBA%20help%20for%20a%20Macro%20(inserting%20picture%20from%20file)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1781323%22%20slang%3D%22en-US%22%3EThis%20works%20great%20except%20it%20is%20not%20placing%20my%20picture%20according%20to%20size%20and%20location.%20Some%20pictures%20are%20thin%20some%20are%20wide%20and%20the%20don't%20land%20exactly%20where%20I%20told%20them%20too.%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1937126%22%20slang%3D%22en-US%22%3ERe%3A%20VBA%20help%20for%20a%20Macro%20(inserting%20picture%20from%20file)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1937126%22%20slang%3D%22en-US%22%3E%3CP%3EI'm%20having%20the%20same%20issue%20as%20far%20as%20the%20link%20being%20inserted%2C%20but%20not%20the%20picture.%20So%20It%20can't%20be%20shared%20or%20sent%20via%20email%20to%20customers.%20Any%20thoughts%20on%20how%20to%20change%20this%20from%20a%20link%20insert%20to%20a%20picture%20insert%3F%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%20so%20much%20for%20your%20time%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1937814%22%20slang%3D%22de-DE%22%3ERe%3A%20VBA%20help%20for%20a%20Macro%20(inserting%20picture%20from%20file)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1937814%22%20slang%3D%22de-DE%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F883953%22%20target%3D%22_blank%22%3E%40Gstg72%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22VIiyi%22%3E%3CSPAN%20class%3D%22JLqJ4b%20ChMk0b%22%3E%3CSPAN%3ETo%20be%20honest%2C%20I%20asked%20where%20it%20is%20best%20to%20include%20such%20a%20VBA%20code.%3C%2FSPAN%3E%3C%2FSPAN%3E%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22VIiyi%22%3E%3CSPAN%20class%3D%22JLqJ4b%20ChMk0b%22%3E%3CSPAN%3EMost%20of%20them%20say%20with%20Outlook%2C%20not%20Excel.%3C%2FSPAN%3E%3C%2FSPAN%3E%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22VIiyi%22%3E%3CSPAN%20class%3D%22JLqJ4b%20ChMk0b%22%3E%3CSPAN%3ES%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22VIiyi%22%3E%3CSPAN%20class%3D%22JLqJ4b%20ChMk0b%22%3E%3CSPAN%3Eo%20I%20searched%20the%20internet%20and%20found%20this%20information.%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22VIiyi%22%3E%3CSPAN%20class%3D%22JLqJ4b%20ChMk0b%22%3E%3CSPAN%3EFolder%20selection%20when%20sending%3C%2FSPAN%3E%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22JLqJ4b%20ChMk0b%22%3E%3CSPAN%3EWith%20this%20VBA%20code%2C%20any%20e-mail%20folder%20can%20be%20selected%20as%20storage%20when%20sending%20an%20e-mail.%3C%2FSPAN%3E%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22JLqJ4b%20ChMk0b%22%3E%3CSPAN%3ETo%20use%20this%20example%2C%20please%20note%20the%20important%20information%20and%20the%20workshop%20Using%20VBA%20in%20Outlook.%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22VIiyi%22%3E%3CSPAN%20class%3D%22JLqJ4b%20ChMk0b%22%3E%3CSPAN%3EPlease%20copy%20the%201st%20part%20of%20the%20code%20into%20a%20new%20module%20(insert%20-%26gt%3B%20module%20in%20the%20VBA%20editor)%3A%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3EOption%20Explicit%0A%20%0APublic%20Function%20SentFolder%20(ByRef%20Item%20As%20Object)%20As%20Boolean%0A%20%0A%20%20%20%20'%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%20%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%0A%20%20%20%20''%20Displays%20the%20Outlook%C2%AE%20selection%20folder%20when%20sending%20an%20email%0A%20%20%20%20'If%20required%2C%20e-mail%20to%20a%20folder%20other%20than%20%22Sent%20Items%22%0A%20%20%20%20'to%20discard.%0A%20%20%20%20'(c)%20http%3A%2F%2Fwww.outlook-stuff.com%0A%20%20%20%20'2008-11-19%20version%201.0.1%0A%20%20%20%20'%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%20%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%0A%0A%20%20%20%20Dim%20obj%20Folder%20As%20Object%0A%20%0A%20%20%20%20'-------------------------------------------------%20--------------------%0A%20%20%20%20'Although%20the%20SaveSentMessageFolder-%0A%20%20%20%20'property%20should%20also%20be%20possible%20for%20meeting%20requests%0A%20%20%20%20'there%20is%20a%20mistake%20with%20these.%20Hence%2C%20prior%20to%20using%20this%0A%20%20%20%20'Function%20asks%20whether%20the%20item%20is%20an%20email.%0A%20%20%20%20'-------------------------------------------------%20--------------------%0A%20%20%20%20If%20Not%20Item.Class%20%3D%20olMail%20Then%20Exit%20Function%0A%20%0A%20%20%20%20'-------------------------------------------------%20--------------------%0A%20%20%20%20'The%20loop%20is%20run%20through%20until%20a%20valid%20folder%20is%20selected%0A%20%20%20%20'or%20the%20selection%20is%20canceled.%0A%20%20%20%20'-------------------------------------------------%20--------------------%0A%20%20%20%20do%0A%20%0A%20%20%20%20%20%20%20%20'-------------------------------------------------%20----------------%0A%20%20%20%20%20%20%20%20'Show%20folder%20selection%0A%20%20%20%20%20%20%20%20'-------------------------------------------------%20----------------%0A%20%20%20%20%20%20%20%20Set%20objFolder%20%3D%20Nothing%0A%20%20%20%20%20%20%20%20Set%20objFolder%20%3D%20Outlook.Session.PickFolder%0A%20%0A%20%20%20%20%20%20%20%20'-------------------------------------------------%20----------------%0A%20%20%20%20%20%20%20%20'Has%20the%20selection%20been%20canceled%3F%0A%20%20%20%20%20%20%20%20'-------------------------------------------------%20----------------%0A%20%20%20%20%20%20%20%20If%20objFolder%20Is%20Nothing%20Then%0A%20%20%20%20%20%20%20%20%20%20%20%20SentFolder%20%3D%20True%0A%20%20%20%20%20%20%20%20%20%20%20%20Exit%20function%0A%20%20%20%20%20%20%20%20End%20If%0A%20%0A%20%20%20%20%20%20%20%20'-------------------------------------------------%20----------------%0A%20%20%20%20%20%20%20%20'Wrong%20folder%20type%20selected%3F%0A%20%20%20%20%20%20%20%20'-------------------------------------------------%20----------------%0A%20%20%20%20%20%20%20%20If%20InStr%20(objFolder.DefaultMessageClass%2C%20%22IPM.Note%22)%20%3D%200%20Then%0A%20%20%20%20%20%20%20%20%20%20%20%20Set%20objFolder%20%3D%20Nothing%0A%20%20%20%20%20%20%20%20%20%20%20%20If%20MsgBox%20(%22Please%20select%20a%20folder%20for%20emails.%22%20_%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2C%20vbCritical%20%2B%20vbOKCancel%2C%20%22Select%20shelf%22)%20%3D%20vbCancel%20Then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20SentFolder%20%3D%20True%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20Exit%20function%0A%20%20%20%20%20%20%20%20%20%20%20%20End%20If%0A%20%20%20%20%20%20%20%20End%20If%0A%20%0A%20%20%20%20%20%20%20%20'-------------------------------------------------%20----------------%0A%20%20%20%20%20%20%20%20'The%20inbox%20is%20not%20suitable%20as%20a%20shelf%0A%20%20%20%20%20%20%20%20'-------------------------------------------------%20----------------%0A%20%20%20%20%20%20%20%20If%20Not%20objFolder%20Is%20Nothing%20Then%0A%20%20%20%20%20%20%20%20%20%20%20%20If%20objFolder%20%3D%20Outlook.Session.GetDefaultFolder%20(olFolderInbox)%20Then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20If%20MsgBox%20(%22Are%20you%20sure%20you%20want%20to%20put%20the%20sent%20email%20in%20the%20inbox%3F%22%20_%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%2C%20vbExclamation%20%2B%20vbYesNo%20%2B%20vbDefaultButton2%2C%20%22Select%20storage%22)%20%3D%20vbNo%20Then%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20Set%20objFolder%20%3D%20Nothing%0A%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20End%20If%0A%20%20%20%20%20%20%20%20%20%20%20%20End%20If%0A%20%20%20%20%20%20%20%20End%20If%0A%20%0A%20%20%20%20Loop%20While%20objFolder%20Is%20Nothing%0A%20%0A%20%20%20%20'-------------------------------------------------%20--------------------%0A%20%20%20%20'Define%20the%20storage%20location%20of%20the%20email%0A%20%20%20%20'-------------------------------------------------%20--------------------%0A%20%20%20%20Set%20Item.SaveSentMessageFolder%20%3D%20objFolder%0A%20%0A%20%20%20%20'-------------------------------------------------%20--------------------%0A%20%20%20%20'Delete%20reference%20to%20folder%0A%20%20%20%20'-------------------------------------------------%20--------------------%0A%20%20%20%20Set%20objFolder%20%3D%20Nothing%0A%20%0AEnd%20function%0A%0A'source%3A%20https%3A%2F%2Fwww.outlook-stuff.com%2Ftipps-tricks%2Fprogrammierung%2F287-ordnerauswahl-'beim-senden.html%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22VIiyi%22%3E%3CSPAN%20class%3D%22JLqJ4b%20ChMk0b%22%3E%3CSPAN%3EThe%20call%20is%20made%20from%20the%20Application_ItemSend%20event%20in%20the%20module%20ThisOutlookSession.%3C%2FSPAN%3E%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22JLqJ4b%20ChMk0b%22%3E%3CSPAN%3EPlease%20copy%20the%202nd%20part%20of%20the%20code%20here%3A%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%20class%3D%22lia-code-sample%20language-applescript%22%3E%3CCODE%3E%C3%9Cbersetzungstypen%0AText%C3%BCbersetzung%0AAusgangstext%0A908%20%2F%205000%0A%C3%9Cbersetzungsergebnisse%0APrivate%20Sub%20Application_ItemSend%20(ByVal%20Item%20As%20Object%2C%20Cancel%20As%20Boolean)%0A%20%0A%20%20%20%20%20'%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%20%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%0A%20%20%20%20%20'This%20procedure%20is%20recorded%20immediately%20before%20an%20email%20is%20sent.%0A%20%20%20%20%20'%20call.%20If%20%22Cancel%22%20is%20true%2C%20the%20sending%20of%20the%20e-mail%20is%20canceled.%0A%20%20%20%20%20'(c)%20http%3A%2F%2Fwww.outlook-stuff.com%0A%20%20%20%20%20'2008-11-19%20version%201.0.1%0A%20%20%20%20%20'%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%20%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%3D%0A%20%20%20%20%20%20%20%0A%20%20%20%20%20'-------------------------------------------------%20--------------------%0A%20%20%20%20%20'Show%20folder%20selection%20for%20storing%20the%20sent%20mail%0A%20%20%20%20%20'-------------------------------------------------%20--------------------%0A%20%20%20%20%20Cancel%20%3D%20SentFolder%20(Item)%0A%20%0A%20%20%20%20%20'-------------------------------------------------%20--------------------%0A%20%20%20%20%20'Delete%20reference%20to%20email%0A%20%20%20%20%20'-------------------------------------------------%20--------------------%0A%20%20%20%20%20Set%20Item%20%3D%20Nothing%0A%20%0AEnd%20Sub%3C%2FCODE%3E%3C%2FPRE%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3CSPAN%20class%3D%22VIiyi%22%3E%3CSPAN%20class%3D%22JLqJ4b%20ChMk0b%22%3E%3CSPAN%3EAt%20the%20beginning%20I%20wouldn't%20have%20thought%20that%20it%20could%20be%20so%20difficult.%3C%2FSPAN%3E%3C%2FSPAN%3E%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22VIiyi%22%3E%3CSPAN%20class%3D%22JLqJ4b%20ChMk0b%22%3E%3CSPAN%3EIn%20retrospect%2C%20however%2C%20I%20understand%20watum%20it's%20so%20hard.%3C%2FSPAN%3E%3C%2FSPAN%3E%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22VIiyi%22%3E%3CSPAN%20class%3D%22JLqJ4b%20ChMk0b%22%3E%3CSPAN%3EIt's%20not%20about%20Excel%2C%20it's%20about%20Outlook.%3C%2FSPAN%3E%3C%2FSPAN%3E%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22VIiyi%22%3E%3CSPAN%20class%3D%22JLqJ4b%20ChMk0b%22%3E%3CSPAN%3EIt%20doesn't%20really%20matter%20if%20I%20send%20an%20Excel%20file%20or%20another%20file%20as%20an%20e-mail.%3C%2FSPAN%3E%3C%2FSPAN%3E%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E-------------------%3C%2FP%3E%3CP%3ESupplement%3A%3C%2FP%3E%3CP%3E(Step%20by%20step)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EOutlook%2C%20start%20the%20VBA%20editor%20successfully.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20add%20Code%201%20via%20%22Insert%20%2F%20Module%22.%20In%20the%20drop-down%20menus%20in%20the%20pop-up%20window%2C%20(%22Selection%22)%2C%20(%22Declarations%22)%20remains.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20left%20is%20now%20under%20Project1%20(VbaProject.OTM)%3C%2FP%3E%3CP%3E-%20Microsoft%20Outlook%20objects%3C%2FP%3E%3CP%3E-%20ThisOutlookSession%3C%2FP%3E%3CP%3E-%20modules%3C%2FP%3E%3CP%3E-%20Module%201%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20I%20now%20double-click%20%22ThisOutlookSession%22%2C%20a%20window%20opens%20again%2C%20the%20drop-down%20menu%20says%20%22Application%22%20on%20the%20left%20and%20%22ItemSend%22%20on%20the%20right.%3C%2FP%3E%3CP%3EI%20copy%20code%202%20into%20the%20free%20field.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20save%20everything%20(without%20renaming%20anything)%2C%20go%20back%20to%20Outlook%2C%20restart%20Outlook.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhen%20I%20write%20an%20email%20now%2C%20I%20get%20various%20error%20messages%3A%3C%2FP%3E%3CP%3EFirst%20runtime%20error%20for%20%22AddinTools%20Classic%20Menu%20for%20Outlook%22.%3C%2FP%3E%3CP%3EThen%20the%20VBA%20editor%20opens%20again%2C%20module%201%20is%20marked%20on%20the%20left%20and%20the%20pop-up%20window%20reads%3A%3C%2FP%3E%3CP%3E%22Error%20during%20compilation%2C%20invalid%20outside%20of%20a%20procedure%2C%20module%201%20marked%22.%3C%2FP%3E%3CP%3EIf%20I%20click%20away%2C%20I%20quit%20the%20debugger.%3C%2FP%3E%3CP%3EDon't%20forget%20to%20reactivate%20the%20macros.%3C%2FP%3E%3CP%3E----------------------------------------------%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22VIiyi%22%3E%3CSPAN%20class%3D%22JLqJ4b%20ChMk0b%22%3E%3CSPAN%3EI%20hope%20that%20you%20will%20get%20a%20little%20further%20with%20it.%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you%20for%20your%20understanding%20and%20patience%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENikolino%3C%2FP%3E%3CP%3EI%20know%20I%20don't%20know%20anything%20(Socrates)%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1938071%22%20slang%3D%22de-DE%22%3ESubject%3A%20VBA%20help%20for%20a%20Macro%20(inserting%20picture%20from%20file)%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1938071%22%20slang%3D%22de-DE%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F140848%22%20target%3D%22_blank%22%3E%40brady%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22VIiyi%22%3E%3CSPAN%20class%3D%22JLqJ4b%20ChMk0b%22%3E%3CSPAN%3EHere%20is%20a%20very%20simple%20solution%20that%20also%20works%20...%20has%20been%20tested.%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22VIiyi%22%3E%3CSPAN%20class%3D%22JLqJ4b%20ChMk0b%22%3E%3CSPAN%3EOpen%20the%20file%20and%20enable%20all%20macros%20and%20content%2C%20then%20click%20the%20%22Insert%20Photo%22%20button.%3C%2FSPAN%3E%3C%2FSPAN%3E%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22VIiyi%22%3E%3CSPAN%20class%3D%22JLqJ4b%20ChMk0b%22%3E%3CSPAN%3EAn%20explorer%20appears%20where%20you%20can%20search%20for%20and%20select%20your%20picture%20and%20confirm%20with%20OK.%3C%2FSPAN%3E%3C%2FSPAN%3E%20%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22VIiyi%22%3E%3CSPAN%20class%3D%22JLqJ4b%20ChMk0b%22%3E%3CSPAN%3EThen%20a%20window%20will%20appear%20asking%20you%20to%20click%20on%20the%20start%20cell%20where%20the%20photo%20should%20be%20inserted.%20Click%20on%20the%20start%20cell%20and%20the%20picture%20is%20where%20you%20want%20it%20to%20be.%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20would%20be%20happy%20to%20know%20if%20I%20could%20help.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ENikolino%3C%2FP%3E%3CP%3EI%20know%20I%20don't%20know%20anything%20(Socrates)%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E*%20Kindly%20Mark%20and%20Vote%20this%20reply%20if%20it%20helps%20please%2C%20as%20it%20will%20be%20beneficial%20to%20more%20community%20members%20reading%20here.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
Occasional Contributor

Hi,

 

I am new to VBA and macros and I was hoping that someone could help me writing the VBA to insert a photo from your personal files. I created the button, but I just need to write the VBA to pull up the users files so they can select the photo. From there I want the photo to be placed in the cell (you'll see on the sheet which cell I am referring to). The cells are already merged together. I want the photo to fit in the cell that is already merged. 

 

For some reason this forum won't let me upload a macro, so I am going to insert the excel file. You'll see where I want the photo's on the "FLYER V1" tab. 

 

Thanks! Let me know if you have any questions 

17 Replies

Brady-

 

Please follow the below steps to accomplish your task:

 

1. Open the Visual Basic Editor (VBE) using Alt + F11

2. Insert > Module

3. Paste the below code in the new code module

 

Sub GetPic()
Dim fNameAndPath As Variant
Dim img As Picture
fNameAndPath = Application.GetOpenFilename(Title:="Select Picture To Be Imported")
If fNameAndPath = False Then Exit Sub
    Set img = ActiveSheet.Pictures.Insert(fNameAndPath)
    With img
       'Resize Picture to fit in the range....
       .Left = ActiveSheet.Range("D9").Left
       .Top = ActiveSheet.Range("D9").Top
       .Width = ActiveSheet.Range("D9:H9").Width
       .Height = ActiveSheet.Range("D9:D28").Height
       .Placement = 1
       .PrintObject = True
    End With
End Sub

4. Go back to the worksheet

5. Right Click on the button > Assign Macro

6. Select the GetPic Macro

 

After following these steps you should get the expected result.

Highlighted

Brady-

 

Just wanted to follow up and see if you were able to resolve your issue.  If you're still having trouble don't hesitate to reach back out and ask additional inquiries.  Always happy to help!

Highlighted

That code worked perfectly, my question is I have 6 other locations to place the same image how can I do so for the other 6?

Highlighted

Hey dklein_14-

Can you please tell me a few things for clarification?

What are the 6 different ranges?  If the ranges are on different worksheets can you further clarify with worksheet names?

-Matt

Highlighted

@Matt Mickle the locations for the 6 other images are as follows:

and all on same worksheet.
.Left = ActiveSheet.Range("q3").Left
.Top = ActiveSheet.Range("q3").Top
.Width = ActiveSheet.Range("q4:q8").Width
.Height = ActiveSheet.Range("r4:r8").Height .Placement = 1

2
.Left = ActiveSheet.Range("q33").Left
.Top = ActiveSheet.Range("q33").Top
.Width = ActiveSheet.Range("q33:q38").Width
.Height = ActiveSheet.Range("r33:r38").Height

3
.Left = ActiveSheet.Range("q63").Left
.Top = ActiveSheet.Range("q63").Top
.Width = ActiveSheet.Range("q63:q68").Width
.Height = ActiveSheet.Range("r68:r68").Height

They are all about 30 cell spaces lower and I have 7 total. In additional I have a sheet labeled Title Page and there 1 image there with the follow location.
Title Page
.Left = ActiveSheet.Range("B3").Left
.Top = ActiveSheet.Range("B3").Top
.Width = ActiveSheet.Range("B3:b9").Width
.Height = ActiveSheet.Range("e9:e9").Height

Thank you for your help!

 

Highlighted

@dklein_14 

 

Try the below code example which loops through multiple locations on the worksheet.  I have commented the code for better understanding.

 

You may want to  note that when you set the width to a value like B3:B9 that is will simple make the image the length of the B column or similarly for E9:E9 it will make the height of the image the height  of cell E9.

 

Sub GetPic()

Dim fNameAndPath     As Variant
Dim img              As Picture
Dim intLp            As Integer
Dim arrLeftandTop    As Variant
Dim arrWidth         As Variant
Dim arrHeight        As Variant

fNameAndPath = Application.GetOpenFilename(Title:="Select Picture To Be Imported") 'Open FIle Dialog to allow user to pick picture
If fNameAndPath = False Then Exit Sub 'If the user cancels then exit the procedure....

    'Define the different range arrays
    arrLeftandTop = Array("B3", "Q3", "Q33", "Q63") 'Left and top range values
    arrWidth = Array("B3:B9", "Q4:Q8", "Q33:Q38", "Q63:Q68") 'Width range values
    arrHeight = Array("E9:E9", "R4:R8", "R33:R38", "R68:R68") 'Height range values
    
    'Loop through ranges and place pictures one at a time....
    'Note arrays start at 0
    ' arrLeftandTop(0) = "B3"
    ' arrLeftandTop(1) = "Q3"
    '.....etc
    For intLp = 0 To 3
    
        Set img = ActiveSheet.Pictures.Insert(fNameAndPath) 'Set image for insert
        With img
           'Resize Picture to fit in the range....
           .Left = ActiveSheet.Range(arrLeftandTop(intLp)).Left
           .Top = ActiveSheet.Range(arrLeftandTop(intLp)).Top
           .Width = ActiveSheet.Range(arrWidth(intLp)).Width
           .Height = ActiveSheet.Range(arrHeight(intLp)).Height
           .Placement = 1
           .PrintObject = True
        End With
    
    Next intLp 'Go to next array value... i.e. first loop is 0, next loop is 1....etc.
    
End Sub
Highlighted

Hello Matt Mickle 

Can you help me on this Macro Please. I want to insert Picture but this Macro is not working in my MacBook maybe this Macro for PC computer. 

Highlighted

Hey @Matt Mickle 

 

I'm having problems with this Macro for inserting photos. I copied it from a PC parallel to use on my Mac but it's keeps telling me the file doesn't exist. Can you help? 

I uploaded a test file, the other one is a much larger file. 

 

Sub InsertAnyPicture() Dim image As String Columns("A:B").Select Selection.Insert Shift:=xlToRight Range("A2").Select ActiveCell.FormulaR1C1 = _ "=CONCATENATE(""E:\Users\Tamara\Desktop\MIASTOCK INVENTORY\images\"",RC[2],"".jpeg"")" Application.Goto Reference:="OFFSET(R2C1,0,0,COUNTA(C3)-1,1)" Selection.FillDown Application.Goto Reference:="OFFSET(R2C1,0,0,COUNTA(C3)-1,1)" Set InputedRange = Range(Selection.Address) For Each C In InputedRange C.RowHeight = 45.5 image = C.Value If File_Exists(image) = True Then Call AddPic(image, C.Offset(0, 1)) Else C.Offset(0, 1).Value = "NO FILE" End If If C.Value = "" Then Exit Sub End If Next C Range("a1").Select Columns(1).EntireColumn.Delete End Sub Sub AddPic(sFile As String, r As Range) With r.Areas(1) ActiveSheet.Shapes.AddPicture FileName:=sFile, _ LinkToFile:=msoFalse, _ SaveWithDocument:=msoTrue, _ Top:=.Top, Left:=.Left, _ Height:=45, Width:=45 End With End Sub Private Function File_Exists(ByVal sPathName As String, Optional Directory As Boolean) As Boolean 'Returns True if the passed sPathName exist 'Otherwise returns False On Error Resume Next If sPathName <> "" Then If IsMissing(Directory) Or Directory = False Then File_Exists = (Dir$(sPathName) <> "") Else File_Exists = (Dir$(sPathName, vbDirectory) <> "") End If End If End Function

Highlighted

@Matt Mickle 

This was great! is there a way to allow multiple uploads at once?

Highlighted

@Matt Mickle This is great. But could you suggest how I could embed the photos within the document as opposed to being a link

 

Highlighted

@brady 

 

After using the VBA how to break the link from images. As the file is shared through email and images will goes off

Highlighted

@Matt Mickle 

 

Great tool. Do you know if there is away instead of specifying the exact cell that you could have it say in the adjacent cell. I have a spreadsheet that I would like to use this Macro several times but instead of having multiple macros each specifying each cell can I make it dependent on the button?

Highlighted

@brady 

 

Look the File please

If it helped, I am very happy ... please mark this as the correct answer so that others are informed. If not, please give a short feedback, maybe the other helpers could help more than me.

 

Nikolino

I know I don't know anything (Socrates)

Highlighted
This works great except it is not placing my picture according to size and location. Some pictures are thin some are wide and the don't land exactly where I told them too.
Highlighted

I'm having the same issue as far as the link being inserted, but not the picture. So It can't be shared or sent via email to customers. Any thoughts on how to change this from a link insert to a picture insert? 

 

Thanks so much for your time

Highlighted

@Gstg72 

To be honest, I asked where it is best to include such a VBA code.

Most of them say with Outlook, not Excel.

So I searched the internet and found this information.

 

Folder selection when sending With this VBA code, any e-mail folder can be selected as storage when sending an e-mail. To use this example, please note the important information and the workshop Using VBA in Outlook.

Please copy the 1st part of the code into a new module (insert -> module in the VBA editor):

 

 

Option Explicit
 
Public Function SentFolder (ByRef Item As Object) As Boolean
 
    '================================================== =====================
    '' Displays the Outlook® selection folder when sending an email
    'If required, e-mail to a folder other than "Sent Items"
    'to discard.
    '(c) http://www.outlook-stuff.com
    '2008-11-19 version 1.0.1
    '================================================= =====================

    Dim obj Folder As Object
 
    '------------------------------------------------- --------------------
    'Although the SaveSentMessageFolder-
    'property should also be possible for meeting requests
    'there is a mistake with these. Hence, prior to using this
    'Function asks whether the item is an email.
    '------------------------------------------------- --------------------
    If Not Item.Class = olMail Then Exit Function
 
    '------------------------------------------------- --------------------
    'The loop is run through until a valid folder is selected
    'or the selection is canceled.
    '------------------------------------------------- --------------------
    do
 
        '------------------------------------------------- ----------------
        'Show folder selection
        '------------------------------------------------- ----------------
        Set objFolder = Nothing
        Set objFolder = Outlook.Session.PickFolder
 
        '------------------------------------------------- ----------------
        'Has the selection been canceled?
        '------------------------------------------------- ----------------
        If objFolder Is Nothing Then
            SentFolder = True
            Exit function
        End If
 
        '------------------------------------------------- ----------------
        'Wrong folder type selected?
        '------------------------------------------------- ----------------
        If InStr (objFolder.DefaultMessageClass, "IPM.Note") = 0 Then
            Set objFolder = Nothing
            If MsgBox ("Please select a folder for emails." _
                , vbCritical + vbOKCancel, "Select shelf") = vbCancel Then
                SentFolder = True
                Exit function
            End If
        End If
 
        '------------------------------------------------- ----------------
        'The inbox is not suitable as a shelf
        '------------------------------------------------- ----------------
        If Not objFolder Is Nothing Then
            If objFolder = Outlook.Session.GetDefaultFolder (olFolderInbox) Then
                If MsgBox ("Are you sure you want to put the sent email in the inbox?" _
                    , vbExclamation + vbYesNo + vbDefaultButton2, "Select storage") = vbNo Then
                    Set objFolder = Nothing
                End If
            End If
        End If
 
    Loop While objFolder Is Nothing
 
    '------------------------------------------------- --------------------
    'Define the storage location of the email
    '------------------------------------------------- --------------------
    Set Item.SaveSentMessageFolder = objFolder
 
    '------------------------------------------------- --------------------
    'Delete reference to folder
    '------------------------------------------------- --------------------
    Set objFolder = Nothing
 
End function

'source: https://www.outlook-stuff.com/tipps-tricks/programmierung/287-ordnerauswahl-'beim-senden.html

 

 

The call is made from the Application_ItemSend event in the module ThisOutlookSession. Please copy the 2nd part of the code here:

 

 

Übersetzungstypen
Textübersetzung
Ausgangstext
908 / 5000
Übersetzungsergebnisse
Private Sub Application_ItemSend (ByVal Item As Object, Cancel As Boolean)
 
     '================================================= =====================
     'This procedure is recorded immediately before an email is sent.
     ' call. If "Cancel" is true, the sending of the e-mail is canceled.
     '(c) http://www.outlook-stuff.com
     '2008-11-19 version 1.0.1
     '================================================== =====================
       
     '------------------------------------------------- --------------------
     'Show folder selection for storing the sent mail
     '------------------------------------------------- --------------------
     Cancel = SentFolder (Item)
 
     '------------------------------------------------- --------------------
     'Delete reference to email
     '------------------------------------------------- --------------------
     Set Item = Nothing
 
End Sub

 

 

 At the beginning I would not have thought that it could be so difficult.

In retrospect, however, I understand watum it's so hard.

It's not about Excel, it's about Outlook.

It doesn't really matter whether I send an Excel file or another file as an e-mail.

-------------------

Supplement:

(Step by step)

 

Outlook, start the VBA editor successfully.

 

I add Code 1 via "Insert / Module". In the drop-down menus in the pop-up window, (“Selection”), (“Declarations”) remains.

 

The left is now under Project1 (VbaProject.OTM)

- Microsoft Outlook objects

- ThisOutlookSession

- modules

- Module 1

 

If I now double-click “ThisOutlookSession”, a window opens again, the drop-down menu says “Application” on the left and “ItemSend” on the right.

I copy code 2 into the free field.

 

I save everything (without renaming anything), go back to Outlook, restart Outlook.

 

When I write an email now, I get various error messages:

First runtime error for "AddinTools Classic Menu for Outlook".

Then the VBA editor opens again, module 1 is marked on the left and the pop-up window reads:

"Error during compilation, invalid outside of a procedure, module 1 marked".

If I click away, I quit the debugger.

Don't forget to reactivate the macros.

----------------------------------------------

I hope that you will get a little further with it.

 

Thank you for your understanding and patience

 

Nikolino

I know I don't know anything (Socrates)

Highlighted

@brady 

 

Here is a very simple solution that also works ... has been tested.

Open the file and enable all macros and content, then click the "Insert Photo" button.

An explorer appears where you can search for and select your picture and confirm with OK.

Then a window will appear asking you to click on the start cell where the photo should be inserted. Click on the start cell and the picture is where you want it to be.

 

I would be happy to know if I could help.

 

Nikolino

I know I don't know anything (Socrates)

 

* Kindly Mark and Vote this reply if it helps please, as it will be beneficial to more Community members reading here.