LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1
Default Macro Image Import Size Issue

I have a spreadsheet that loads multiple tif images into a form based on the
file name. The original size of the tif images are 522x266. When the images
are imported they are resized to 77% Height, 62% Width. In Excel 2003 and
earlier the macro I created worked very well, the images were loaded and
resized. In Excel 2007, the images are imported but the size of the image is
incorrect. When I look at the properties of the picture the height is
correct, the width is incorrect. The aspect ratio of the picture is being
maintaned. Apparently in 2007 the Lock Aspect Ratio overides my custom
dimensions. I cannot figure out how to have the images load with a custom
size in Excel 2007. I can obviously select all of the images, remove the
lock aspect ratio setting and change the dimensions, but that takes time.

Here is the code I am using to import the image.

PictureForward: 'Load Forward files
Range("M18").Select
For PicI = 0 To 14
Sheets("Setup").Range("AP18") = PicI ' dev
If PicI = 6 Then 'Page 2
OffsetHeight = 65: OffsetCell = 5
End If
If PicI = 12 Then 'Page 3
OffsetHeight = 131: OffsetCell = 10
End If
If FDate(PicI) < "" Then
insert_file = Cert_Dir & FDate(PicI)
Sheets("Setup").Range("O22") = insert_file ' dev
If Exten = ".gif" Then
ActiveSheet.Pictures.Insert(insert_file, xlTIF).Select
Else
ActiveSheet.Pictures.Insert(insert_file).Select
End If
Selection.Width = 245: Selection.Height = 155:
If (PicI / 2) - Int(PicI / 2) 0 Then
Selection.Left = 290 'Right Picture
Selection.Top = TpFTif + OffsetHeight + (101 * (PicI - 1))
Cells((TpFTF + OffsetCell + (8 * (PicI - 1))), 13).Value =
FDate(PicI)
Else
Selection.Left = 27 'Left Picture
Selection.Top = TpFTif + OffsetHeight + (101 * PicI)
Cells((TpFTF + OffsetCell + (8 * PicI)), 8).Value = FDate(PicI)
End If
End If
Application.ScreenUpdating = False
Next PicI
Return
 
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
Sum Prodcut issue from .txt import Chicago Joe Excel Worksheet Functions 1 June 19th 08 10:58 PM
Size of the background image? bkoren Excel Discussion (Misc queries) 0 January 9th 07 06:55 PM
How to increase size of image in button (msocontrolbutton) of custom toolbar of Excel padam Excel Discussion (Misc queries) 0 August 11th 06 07:18 PM
Import Issue Ed Bailey Excel Discussion (Misc queries) 0 May 1st 06 09:33 PM
File size when using background image? JDThree [MVP] Excel Discussion (Misc queries) 3 May 24th 05 04:04 AM


All times are GMT +1. The time now is 11:50 PM.

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

About Us

"It's about Microsoft Excel"