LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 29
Default Problem in Picture alignment

Hello Sirs,

I have programmed following code to insert pictures into my sheet. But I
found there is problem in code line:.Top = atl.Offset(0, 1).Top

My pictures exact position shp.top is bigger than the range
-atl.offset(0,1).top

please check for me and provide help

thanks advancely



Code as below:


Sub insertpic()

Dim shp As Picture


Dim atl As Range

Dim lujing As String

lujing = "G:\Autoline Tensioner"

With Application
.ScreenUpdating = False
.EnableEvents = False
End With



For Each atl In Selection

With atl

.RowHeight = 102.75
With .EntireRow
.VerticalAlignment = xlTop
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
End With

atl.Offset(0, 1).ColumnWidth = 22.75

Next

For Each atl In Selection


On Error Resume Next

With atl.Offset(0, 1)

Set shp = .Parent.Pictures.Insert(lujing & "\" & atl.Value & ".jpg")
End With

If Err.Number = 0 Then

With shp

.Left = atl.Offset(0, 1).Left
.Top = atl.Offset(0, 1).Top
.Height = 100
.Width = 133
End With

Else

atl.Offset(0, 1).Value = "No existed picture"
atl.Offset(0, 1).Interior.Color = RGB(255, 0, 0)

End If

On Error GoTo 0




Next

With Application
.ScreenUpdating = True
.EnableEvents = True
End With


End Sub

 
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
Alignment problem with spreadsheet Jorge Cervantes New Users to Excel 4 September 18th 09 07:23 PM
Picture alignment Max Excel Programming 6 March 22nd 09 05:27 AM
Col alignment problem newbie in hell Excel Programming 2 February 22nd 07 11:38 PM
Command Button Alignment Problem zabo21 Excel Programming 2 August 1st 05 04:26 PM
Text format alignment problem Steve Excel Programming 3 November 27th 03 02:32 PM


All times are GMT +1. The time now is 01:53 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"