Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 13
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,514
Default 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   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 13
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
while my c# code running ,clicks on excel document interrupts code Kayıhan Excel Programming 2 April 8th 09 11:54 AM
posting code ward376 Excel Programming 1 November 21st 07 11:22 AM
Posting code with IF Robert Excel Programming 7 September 15th 05 07:26 AM
(1) VARIABLE IN POSTING CODE (2) LOOPING Robert Excel Programming 2 September 14th 05 06:31 AM
the owner of posting should be able to delete the posting Mahendra Excel Discussion (Misc queries) 7 August 8th 05 07:21 PM


All times are GMT +1. The time now is 02:57 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright 2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"