vba - Create excel attachment Object using VB or macros in a cell of Excel -
please advise how can create object in cell of excel using macros. please refer below image:
[
i want attach attachment in image using script or kind of formulas.
thanks
here's sample created using method described in comment:
excel macro
'select cell should contain object range("b5").select 'add object given cell activesheet.oleobjects.add(filename:= _ "c:\users\de12668\documents\zeichnung1.vsd", link:=false, displayasicon:= _ true, iconfilename:= _ "c:\windows\installer\{90140000-0057-0000-0000-0000000ff1ce}\visicon.exe", _ iconindex:=0, iconlabel:="a sample"). _ select
update 1
if paths elements provided in first column, use add appropriate links:
dim myrange range dim longlastrow long dim counter long set myrange = worksheets(1).range("a1") longlastrow = cells(rows.count, myrange.column).end(xlup).row counter = 1 longlastrow range("b" & counter).select activesheet.oleobjects.add(filename:= _ range("a" & counter).value, link:=false, displayasicon:= _ true, iconfilename:= _ range("a" & counter).value, _ iconindex:=0, iconlabel:=""). _ select next
Comments
Post a Comment