Import data file from folder image to excel columns -
i have folder several images. import name of file on first column, image note ( can add note , fill image) , pixel dimension ( es: 800x600) on second columns.
it possible ? have many images work with. lot!
sub tgr() const strfolderpath string = "c:\test" dim rngdest range dim oshell object dim varfilename variant dim strdimensions string set oshell = createobject("shell.application").namespace(strfolderpath) sheets.add range("a1:b1") .value = array("name", "dimensions") .font.bold = true .borders(xledgebottom).linestyle = xlcontinuous end set rngdest = range("a2") on error resume next each varfilename in oshell.items strdimensions = oshell.getdetailsof(varfilename, 26) if len(strdimensions) > 0 rngdest .resize(, 2).value = array(varfilename, strdimensions) .comment.delete .addcomment .comment.shape.fill.userpicture strfolderpath & application.pathseparator & varfilename end set rngdest = rngdest.offset(1) end if next varfilename on error goto 0 range("a:b").entirecolumn.autofit set rngdest = nothing set oshell = nothing end sub
Comments
Post a Comment