none
Word 2013 - original size of object RRS feed

  • Question

  • Hi All

    I use Word 2013, where I inserted an Excel object. I open the object with a double-click, add columns, format cells, etc. and click into the Word document to close the Excel object.

    After that the proportions of the object are wrong, it looks warped. In the dialog"Format Object" / "Size"I can see theoriginal size of the object. The "Reset" button resets the Excel object to those values.

    I used theVBArecorderthe get the code for "Clicking on the Reset button" with no success. The values for height and width are fixed values every time calculated while executing.

    I tried to calculate the original values without success. Then I tried to work with the ScaleHeight / ScaleWidth:

    If Selection.Type = wdSelectionInlineShape Then
    Selection.InlineShapes(1).LockAspectRatio = msoFalse
    Selection.InlineShapes(1).ScaleHeight = 100
    Selection.InlineShapes(1).ScaleWidth = 100
    End If

    But it does not work. Does anybody have an idea on how to approach this?

    Thanks for any help.

    Martin


    Wednesday, March 16, 2016 2:55 PM

Answers

  • Unfortunately, the behaviour you're seeing is normal with embedded Excel objects. It seems that Word obtains the correct scaling data from Excel, which is not a true 100%*100%, then applies that. If you were to print the same worksheet data from both Excel and Word, you'd find that the default scaling produces a print of the same size. In Word 2003 & earlier, Word did change the scaling, which meant embedded Excel objects in Word would not print at the same size as they did from Excel. You can see that the scaling in every version of Excel is at fault by inserting a circle in to a worksheet, then printing it - the printed circle will be an oval, wider than it is high!

    Equally unfortunately, you can't retrieve the .ScaleHeight & .ScaleWidth dimensions to adjust them, whether before or after setting them to 100% - they always return 0. So, not knowing how far they're out, you can't adjust them. Worse still, the skewing varies from PC to PC, presumably according to whatever the current printer driver is. On yours, for example, setting .ScaleHeight & .ScaleWidth to 100 results in 97% & 107%; on mine they're 96% & 106%.


    Cheers
    Paul Edstein
    [MS MVP - Word]

    • Marked as answer by Martin Koenig Wednesday, March 23, 2016 9:07 AM
    Tuesday, March 22, 2016 10:13 PM

All replies

  • See: https://support.microsoft.com/en-us/kb/970889 . The Registry patches mentioned there may resolve your problem. With Office 2013, though, you'll need to use:
    HKEY_CURRENT_USER\Software\Microsoft\Office\15.0
    instead of:
    HKEY_CURRENT_USER\Software\Microsoft\Office\12.0

    Cheers
    Paul Edstein
    [MS MVP - Word]

    Wednesday, March 16, 2016 10:08 PM
  • Hi Paul

    I might not have been clear enough. I'm not converting the Excel object into an image, the object stays an Excel object. But when I increas e.g. the width of the columns and close the Excel object Word resizes the Excel object to a funny resolution so it stays in with within the border of the document.

    I then would like to resize it to 100% with a VBA macro and that is where I'm struggeling.

    Thursday, March 17, 2016 1:09 PM
  • The patches aren't really about image conversion, their about maintaining the size & aspect ratio of embedded objects. If you have an embedded Excel object that's already filling the page width and you increase the width of one of the columns, the object will have to resize; otherwise you'd lose part of the right-most column. If the patch doesn't do what you need, we can look at other options but, whatever you do, programmatically adjusting the size to take account of changes made through the embedded object's GUI would be problematic.

    Cheers
    Paul Edstein
    [MS MVP - Word]

    Thursday, March 17, 2016 8:57 PM
  • Hi Martin,

    Have you fixed this issue yet? I am trying to reproduce this issue however failed. Would you mind sharing more detail how we can reproduce this issue?

    Here are my tested steps:
    1. Create a new Word document

    2. Insert a Microsoft Excel Worksheet

    3. Edit the sheet for type data into column A, B, C and format with background color for the cells

    4. Edit the sheet and modify the data in column H

    The size of the embed the Excel object is fixed and like figure below:

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, March 22, 2016 12:36 PM
    Moderator
  • Hi Fei

    Thanks for following up. I insert the excel object. All good.

    Then I open the Excel and complete the columns for the rest of the year and back in Word I reshape the object so it shows every month.

    Then I run the code:

       If Selection.Type = wdSelectionInlineShape Then
            Selection.InlineShapes(1).LockAspectRatio = msoFalse
            Selection.InlineShapes(1).ScaleHeight = 100
            Selection.InlineShapes(1).ScaleWidth = 100
        End If

    The shape seems to be back on 100%

    But actually it is not. Its 'only' on 97% vs 107%. Word shows me the original size and the bottom of the dialog. What VBA Code will help me to calc those values?

    Thanks for every help!

    Martin


    Tuesday, March 22, 2016 1:36 PM
  • Unfortunately, the behaviour you're seeing is normal with embedded Excel objects. It seems that Word obtains the correct scaling data from Excel, which is not a true 100%*100%, then applies that. If you were to print the same worksheet data from both Excel and Word, you'd find that the default scaling produces a print of the same size. In Word 2003 & earlier, Word did change the scaling, which meant embedded Excel objects in Word would not print at the same size as they did from Excel. You can see that the scaling in every version of Excel is at fault by inserting a circle in to a worksheet, then printing it - the printed circle will be an oval, wider than it is high!

    Equally unfortunately, you can't retrieve the .ScaleHeight & .ScaleWidth dimensions to adjust them, whether before or after setting them to 100% - they always return 0. So, not knowing how far they're out, you can't adjust them. Worse still, the skewing varies from PC to PC, presumably according to whatever the current printer driver is. On yours, for example, setting .ScaleHeight & .ScaleWidth to 100 results in 97% & 107%; on mine they're 96% & 106%.


    Cheers
    Paul Edstein
    [MS MVP - Word]

    • Marked as answer by Martin Koenig Wednesday, March 23, 2016 9:07 AM
    Tuesday, March 22, 2016 10:13 PM
  • Dear Paul

    Thanks so much for your excellent explenation.

    Kind regards

    Martin

    Wednesday, March 23, 2016 9:07 AM