3

I'm scratching my head why. Both computers are running Win7 pro 64 bit, and the same version of Excel (Version 1708, Build 8431.2236). There are 8 images inserted in the spreadsheet. This is what I used to report the image width:

    For Each p In ActiveSheet.Shapes
        MsgBox ("TL row: " & p.TopLeftCell.Row & ", TL column: " & p.TopLeftCell.Column & " ,image width: " & p.Width)

Here is what I got on the two computers:

    computer 1                        computer 2
    14, 1, 72                         14, 1, 73.2
    157, 4, 379.5                     157, 4, 386.4
    182, 4, 379.5                     182, 4, 386.4
    208, 4, 379.5                     208, 4, 386.4
    234, 4, 379.5                     234, 4, 386.4
    260, 4, 379.5                     260, 4, 386.4
    286, 4, 379.5                     286, 4, 386.4
    418, 5, 198                       418, 5, 201.6

I understand there may not be an "answer" for my vague question. However any clue/idea would be appreciated!

xyk
  • 133
  • 3
  • 1
    is it the exact same file ? , or are you copy/pasting the shapes from one sheet to another?, shapes in excel can be "anchored" to the cell size, also when copying from one sheet to another with different zoom, excel does not do an exact copy. – arana Apr 03 '18 at 17:16
  • What screen/display resolution do these 2 PCs use? – nixda Apr 03 '18 at 17:52
  • @arana yes exactly same file, no copy/paste involved. – xyk Apr 03 '18 at 18:14
  • @nixda mine is dual 1920 x 1080. I need to track down my co-workers, he's in the field a lot - you think this could be a possible reason? – xyk Apr 03 '18 at 18:15
  • Resolution of the display (and probably scaling too) are almost certainly the culprits here. – music2myear Apr 03 '18 at 18:32
  • Spot on guys, especially @music2myear. I tried it on a 1280x1024 monitor which reports the same numbers as my owner computer. Then I changed the scaling of my display from 100% to 125% and the reported numbers on my computer matched what my co-worker reported. I'm still confused though. I thought the reported size was in number of pixels which should be independent of resolution/scale? Looking up on MSDN it is said to be in "point" - what is exactly a "point"? – xyk Apr 03 '18 at 18:51

1 Answers1

1

A point is an abstract measurement attempting to regularize pixels and scaling in a more real-world metric. (see Update 1 below)

A pixel is a physical construct on your screen with definite and real size and shape.

Scaling is a way to make applications fit to usable sizes on native-resolution-preferring LCDs.

The problem you're experiencing is that Excel is probably using Points to determine the size of a given object, and on different displays with different resolutions and different scaling settings the size of a point may vary, and therefore the layout of the chart or object will also fluctuate.

There are ways to define the size of elements in Excel using empirical measures, but these may simply reverse the problem, not solve it.

UPDATE 1: I may have been incorrect about points. Excel appears to use "PostScript" points, which are an empirical measurement 1/72 of an inch. Points are used in other screen design systems in the way I described above. The root issue is effectively the same though: Excel is attempting to do its best, across different screens, resolutions, and scalings, to make things work correctly.

For additional reading:
https://forums.techguy.org/threads/units-used-in-excel.178564/
How to make cells perfect squares in Excel?
http://dailydoseofexcel.com/archives/2004/06/01/column-widths-in-points/

music2myear
  • 40,472
  • 44
  • 86
  • 127
  • I'm still struggling with the point thing, if there is already real world measurements (such as inch), as well as pixels, what's the advantage of something like a "point". But I definitely know better why I ran into my problems now than before the help from you guys. Thanks! – xyk Apr 03 '18 at 19:30
  • Answer updated. – music2myear Apr 03 '18 at 21:18