Points measurement problem

S

Sharad Naik

Hello every one,

Facing some funny problem with excel.
I was adding some pictures in a sheet, which has ever
worked without problem.
But this time, I was stumped.
Excel suddenly started adding the pictures in wrong position
and wrong size.
After 2 hrs of head scratching I found this.
If you access HPageBreaks or VPageBreaks Property
and then add the picture, the Points scale gets multiplied by
6.2571 !
Please see code below:
I am using HPageBreaks.Count quite earlier in my code,
then last adding some pictures. In Below code I added
line x = .HPageBreaks.Count just to show my point.
When this line is commented off, the pictures get added
at correct position. If comment removed, the pictures
get added with specidied position * 6.2571, size * 6.2571
(ineasted of size 70,70 , it adds size (438,438)

Sub Dec22Presentation()
With ThisWorkbook.Worksheets("Sheet1")
'x = .HPageBreaks.Count
For i = 1 To 5
.Shapes.AddPicture "c:\tph5000.jpg", _
msoFalse, msoTrue, i * 200, 100, 70, 70
Next
End With
End Sub

Any idea how to reset back the points scale?

Sharad
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top