Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
need help importing photos from file folders
I don't even know if anyone is still up... ActiveSheet.Pictures.Insert(loc1).Select I have that line of code to insert a photo. loc1 is hardcoded to go to a certain cell and load the text containing a path. the path is: I:\Lab\Perf\Test Reports\For Lab Only\Test Reports for 2004 Requests\P04332\Defrost Pictures\13 5 Volts\Salt Water Resistance\Sample Number 7 RH\MVC-001F.JPG where everything after "defrost pictures" could change. Is there a way to load every photo regardless of how many there are? I wanted a dynamic way to load all the photos in the "sample number 7 rh" folder, then change only "sample number 8 rh". thanks, richard -- wraithlead ------------------------------------------------------------------------ wraithlead's Profile: http://www.excelforum.com/member.php...o&userid=11578 View this thread: http://www.excelforum.com/showthread...hreadid=271074 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
need help importing photos from file folders
Maybe something like this will get you started:
Option Explicit Sub testme() Application.ScreenUpdating = False Dim myPath As String Dim iCtr As Long Dim myRng As Range Dim myPict As Picture 'change to point at the folder to check myPath = "c:\my documents\my pictures" With Application.FileSearch .NewSearch 'Change this to your directory .LookIn = myPath .Filename = ".jpg" .SearchSubFolders = True If .Execute() 0 Then Set myRng = ActiveSheet.Range("a1:b2") For iCtr = 1 To .FoundFiles.Count Set myPict = ActiveSheet.Pictures.Insert(.FoundFiles(iCtr)) With myPict .Width = myRng.Width .Top = myRng.Top .Height = myRng.Height .Left = myRng.Left .Name = "Pict_" & myRng.Address(0, 0) End With Set myRng = myRng.Offset(2, 0) Next iCtr End If End With Application.ScreenUpdating = True End Sub wraithlead wrote: I don't even know if anyone is still up... ActiveSheet.Pictures.Insert(loc1).Select I have that line of code to insert a photo. loc1 is hardcoded to go to a certain cell and load the text containing a path. the path is: I:\Lab\Perf\Test Reports\For Lab Only\Test Reports for 2004 Requests\P04332\Defrost Pictures\13 5 Volts\Salt Water Resistance\Sample Number 7 RH\MVC-001F.JPG where everything after "defrost pictures" could change. Is there a way to load every photo regardless of how many there are? I wanted a dynamic way to load all the photos in the "sample number 7 rh" folder, then change only "sample number 8 rh". thanks, richard -- wraithlead ------------------------------------------------------------------------ wraithlead's Profile: http://www.excelforum.com/member.php...o&userid=11578 View this thread: http://www.excelforum.com/showthread...hreadid=271074 -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Transferring Excel Data to Make New File Names for Photos | Excel Discussion (Misc queries) | |||
import photos to specific cells named with file name of photo | Excel Discussion (Misc queries) | |||
How to reduce file size of photos inserted in Excel | Excel Discussion (Misc queries) | |||
Importing (Exporting) photos into Excel | Excel Discussion (Misc queries) | |||
Inserted Photos - Enormous Excel File Size | Excel Discussion (Misc queries) |