copy and paste from excel to word

Diego S 11 Reputation points
2022-02-09T08:27:34.267+00:00

Good morning
I developed a VBA Macro in Excel (Office 2013) that which automatically inserted the images, paginated and inserted the correct caption in an Excel sheet.
The final result was the following (see output MACRO VBA.png) :

172388-image.png

At this point I selected the entire block from the xls sheet and, with a simple copy and paste, I was going to insert everything in a word sheet to obtain this result(see Copy&Paste Office 2013.png):
172389-image.png

This happened with the Office 2013 package.
Few month ago, I switched to Office 365.
The Excel macro works correctly giving me the same output as the previous version but, when I go to copy and paste in the Word sheet, I get this result (see Copy&Paste Office 365.png) :
172505-image.png

The images are all staggered to me.
It appears to be an anchoring problem.
While in the first version the anchor point of each image referred to the relative cell, in the latter version the anchor point refers to other points by introducing this offset.
I have compared all the settings of both word and excel between the 2 versions and from what I could see they seem to be the same. Unfortunately I don't know how to fix this.
I thank in advance those who can help me.
Thanks so much

Microsoft 365 and Office Word For business Windows
Microsoft 365 and Office Excel For business Windows
Developer technologies Visual Basic for Applications
0 comments No comments
{count} votes

7 answers

Sort by: Most helpful
  1. John Korchok 6,126 Reputation points
    2022-02-09T12:43:19.413+00:00

    If you can upload a sample document that produces the result in the last screen shot to a cloud service, then post a share link here, I'll take a look at it.

    1 person found this answer helpful.
    0 comments No comments

  2. Diego S 11 Reputation points
    2022-02-09T13:14:50.547+00:00

    Thank you.
    I upload 2 files:

    1. the file correct made with Office 2013
    2. the file uncorrect made with Office 365
      You can find documents here:

    https://we.tl/t-P6dC62tU9n

    Thank you very much for your support

    1 person found this answer helpful.
    0 comments No comments

  3. Diego S 11 Reputation points
    2022-02-09T14:21:32.997+00:00

    Thank you for your answer.
    I

    Yes, in excel pictures are anchored to the table cells. This setting was maintened when I copy and paste in Office 2013 (see example of Imagine 5):
    172615-image.png

    but is totally unreliable in Office 365:

    172605-image.png

    I tried with different kind of anchorage, different kind of paste and also copy format but without any results.

    The difference between 2 table are generated automatically when I paste in the word sheet: the source is the same for both sheet.
    The carriage return, for example, has been inserted automatically.

    Different versions of Word display tables differently. This is a Microsoft design decision.
    Unlucky, this is not good for me :-(

    The printer is the same with the same configuration.
    Yes, I confirm that pasting the 2013 table into the 365 the results is correct but is not useful for me.

    I tried to insert the page break in word 365 as you suggested but the layout became different.
    The layout was studied during the VBA MACRO developing in order to have a correct copy and paste in the word sheet.
    Everything was ok until I switched to Office 365.

    Thank you very much for your support and for you time but from your answer I understand that this is a problem without solution....unlucky.

    1 person found this answer helpful.
    0 comments No comments

  4. John Korchok 6,126 Reputation points
    2022-02-09T13:32:21.857+00:00

    Since you created this in Excel, the pictures are anchored to table cells, but float above them. This positioning is unreliable with the default settings.

    The 2 tables are not identical. Row 7 of the 365 file has a carriage return in the second cell that doesn't exist in the 2013 version.

    Different versions of Word display tables differently. This is a Microsoft design decision.

    Word documents can display differently is a different printer is active. Word get it's page layout parameters from the active printer driver.

    Pasting the 2013 table into Word 365 results in a table identical to the 2013 version.

    To see a consistent page break, make the table grid visible using Table Design>Layout and clicking on View Gridlines. Click in the leftmost cell of a row, then click on Insert>Page Break. Repeat for subsequent pages.

    0 comments No comments

  5. John Korchok 6,126 Reputation points
    2022-02-09T18:42:17.787+00:00

    Try running this first in Word:

    Sub Compatible2013()
    ActiveDocument.SetCompatibilityMode wdWord2013
    End Sub

    It sets your document to Word 2013 compatibility mode, so the table should paste the same as in Word 2013.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.