+ Reply to Thread
Results 1 to 5 of 5

Values not visible in PDF after pasting Excel Range into Word table via VBA

  1. #1
    Registered User
    Join Date
    01-17-2023
    Location
    Hamburg
    MS-Off Ver
    365
    Posts
    11

    Values not visible in PDF after pasting Excel Range into Word table via VBA

    Hi everyone!

    I have a little sub like this as part of a larger Macro editing some Word-Templates:

    Please Login or Register  to view this content.
    My issue now is, that when I run this Macro, all text in the Word table is underlined with dots (see Screenshot below). However, formatting them with the normal Word underscoring does not change anything, so it is not really an underscore. I can only get them removed by copying the range in again by hand. Frustratingly, sometimes the pasting works just fine, but I have yet to find out, when and when not this is happening. Copying the values in the table after the Macro ran, pasting the values as textonly pastes nothing and pasting them as an Image creates a blank white image. Printing/saving the file as PDF makes the whole table appear empty.

    Does anyone know of this issue or have any ideas, what to check for?
    I've got it both to work and the issue to show up
    - in debug mode and running through by itself
    - with and without scrolling to the table so it is visible, when pasting
    - using .PasteAndFormat wdPasteDefault instead of .Paste

    I am really confused as to what the issue is and what could cause it.
    Grateful for any help :)
    Last edited by _christoph; 12-04-2024 at 10:57 AM. Reason: Clarifying the issue

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    47,997

    Re: Values not visible in PDF after pasting Excel Range into Word table via VBA

    For whatever reason the text is hidden, not underlined. So, you need to set the text as visible.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    47,997

    Re: Values not visible in PDF after pasting Excel Range into Word table via VBA

    Please provide sample files: the Excel Workbook with the Range(s)/Table(s) and the Word Template with the bookmarks/Tables.

  4. #4
    Registered User
    Join Date
    01-17-2023
    Location
    Hamburg
    MS-Off Ver
    365
    Posts
    11

    Re: Values not visible in PDF after pasting Excel Range into Word table via VBA

    Many thanks! That was actually the issue.
    TablePosition.Font.Hidden = False solved the problem. I still have no idea, why Excel pasted the text as hidden, but I'm happy enough with this solution.

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    47,997

    Re: Values not visible in PDF after pasting Excel Range into Word table via VBA

    I still have no idea, why Excel pasted the text as hidden, but I'm happy enough with this solution.
    Me neither.

    But, you're welcome.



    Also, you may not be aware that you can thank those who have helped you by clicking the small star icon (Next to Add Reputation) located in the lower left corner of the post in which the help was given. By doing so you can add to the reputation(s) of those who helped.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Pasting Excel data to Word table via Range.PasteAppendTable
    By Karlosus in forum For Other Platforms(Mac, Google Docs, Mobile OS etc)
    Replies: 0
    Last Post: 08-10-2015, 03:34 AM
  2. [SOLVED] Pasting Excel range to Word doc Keeping source formatting, using VBA
    By staggers47 in forum Excel Programming / VBA / Macros
    Replies: 14
    Last Post: 06-14-2013, 10:46 AM
  3. [SOLVED] Pasting into word table from excel
    By Alexander_Golinsky in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-02-2012, 09:44 AM
  4. Pasting Excel into Word table
    By keithfender in forum Excel General
    Replies: 0
    Last Post: 05-28-2009, 02:21 PM
  5. [SOLVED] Pasting a Word Table into Excel
    By Dee in forum Excel General
    Replies: 1
    Last Post: 04-05-2005, 09:06 PM
  6. Table formatting for pasting in Word?
    By astro_al in forum Excel General
    Replies: 0
    Last Post: 02-07-2005, 10:03 AM
  7. Pasting a Table From Word to Excel
    By jyoud in forum Excel General
    Replies: 1
    Last Post: 01-27-2005, 11:25 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1