J
John
I have a worksheet with VBA code that has been in use for at least 12 years.
It still works flawlessly in XL7 (2007). The code opens a folder which
contains 24 photos (5M each) and places them in a worksheet along with their
file name and date. The code even fails when I step thru the code, but seems
to hesitate for some reason. The lines of code which appears to be causing
the problem is as follows:
For x = 10 To 430 Step 140
If Directory = "" Then Exit Sub
ActiveSheet.Shapes.AddPicture Directory & f, _
True, False, x, y, 130, 100
Cells(r, c) = f
Cells(r, c + 1) = FileDateTime(Directory & f)
f = Dir
The line with "Shapes.AddPicture " seems to be the area of concern. XL13
appears to be handling pictures differently, but why?
Any ideas about this line ??
BTW, I have tried the code approximately 25 times. I had one attempt which
completed properly, but it took nearly 45 seconds to complete versus 4-5
seconds for XL7. Very strange.
It still works flawlessly in XL7 (2007). The code opens a folder which
contains 24 photos (5M each) and places them in a worksheet along with their
file name and date. The code even fails when I step thru the code, but seems
to hesitate for some reason. The lines of code which appears to be causing
the problem is as follows:
For x = 10 To 430 Step 140
If Directory = "" Then Exit Sub
ActiveSheet.Shapes.AddPicture Directory & f, _
True, False, x, y, 130, 100
Cells(r, c) = f
Cells(r, c + 1) = FileDateTime(Directory & f)
f = Dir
The line with "Shapes.AddPicture " seems to be the area of concern. XL13
appears to be handling pictures differently, but why?
Any ideas about this line ??
BTW, I have tried the code approximately 25 times. I had one attempt which
completed properly, but it took nearly 45 seconds to complete versus 4-5
seconds for XL7. Very strange.