Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
L2013 not running code from XL7, second posting
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. |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
L2013 not running code from XL7, second posting
I don't have 2013 but did you check in the VBE ObjectBrowser under
Shapes.AddPicture function for a list of args. I normally specify the arg name so there's no ambiguity regardless of order... Filename:=Directory & f, LinkToFile:=False, SaveWithDocument:=True, _ Left:=x, Top:=y, Width:=130, Height:=100 -- Garry Free usenet access at http://www.eternal-september.org Classic VB Users Regroup! comp.lang.basic.visual.misc microsoft.public.vb.general.discussion |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
L2013 not running code from XL7, second posting
I had been under the assumption that no changes have taken with the
"shapes.addpicture" command. A major change took place in XL10 and carried into XL13. First, the picture is now linked to the source (for me undesirable) and the size and position factors have changed. I have to do some studying to understand the two issues. But now that I know changes have occurred, I can tackle the problem. John |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
while my c# code running ,clicks on excel document interrupts code | Excel Programming | |||
posting code | Excel Programming | |||
Posting code with IF | Excel Programming | |||
(1) VARIABLE IN POSTING CODE (2) LOOPING | Excel Programming | |||
the owner of posting should be able to delete the posting | Excel Discussion (Misc queries) |