+ Reply to Thread
Results 1 to 8 of 8

Copy bitmap to specific word document, preferably without closing it.

  1. #1
    Registered User
    Join Date
    12-02-2017
    Location
    Copenhagen, Denmark
    MS-Off Ver
    2016
    Posts
    55

    Copy bitmap to specific word document, preferably without closing it.

    I'm trying to copy a range as bitmap to a specific worddocument. The values of the range will change several times when working, so I will have to copy it several times.

    My code is:

    Please Login or Register  to view this content.
    I'm not experienced enough with having Excel work with Word, so I don't know how to adjust the above code to make it work.
    But as I explained above, I want the A1:M40 range copied to the wordname.docx, preferably without closing wordname.docx everytime.
    wordname.docx will already have been created when opening the workbook (this works perfectly), so this code will have to add to it. So, I don't know if the
    Please Login or Register  to view this content.
    is necessary, but leaving it out doesn't help.

    I hope I've explained myself well enough
    Do you have any solutions to how I can copy the range with ease to the word document?

  2. #2
    Registered User
    Join Date
    12-02-2017
    Location
    Copenhagen, Denmark
    MS-Off Ver
    2016
    Posts
    55

    Re: Copy bitmap to specific word document, preferably without closing it.

    Attachment 671746

    I just found out, that the reason the code doesn't is because of the message in the screenshot I've attached.
    Anyway to work around this in the code?

  3. #3
    Registered User
    Join Date
    12-02-2017
    Location
    Copenhagen, Denmark
    MS-Off Ver
    2016
    Posts
    55

    Re: Copy bitmap to specific word document, preferably without closing it.

    I figured out how to do it after a lot of googling, but it has some requirements. Here it is:

    First I have a macro run when opening workbook:

    Please Login or Register  to view this content.
    I first create the word.docx and name it. The next executes when the bitmap is ready to be copy-pasted:

    Please Login or Register  to view this content.
    This way it works perfectly, but it requires that the word.docx is open when working, and probably need it to be the only word.docx open.

  4. #4
    Forum Moderator AliGW's Avatar
    Join Date
    08-10-2013
    Location
    Retired in Ipswich, Suffolk, but grew up in Sawley, Derbyshire (England)
    MS-Off Ver
    MS 365 Subscription Insider Beta Channel v. 2404 (Windows 11 22H2 64-bit)
    Posts
    80,916

    Re: Copy bitmap to specific word document, preferably without closing it.

    Thanks for letting us know.

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.
    Ali


    Enthusiastic self-taught user of MS Excel who's always learning!
    Don't forget to say "thank you" in your thread to anyone who has offered you help.
    You can reward them by clicking on * Add Reputation below their user name on the left, if you wish.

    Forum Rules (updated August 2023): please read them here.

  5. #5
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: Copy bitmap to specific word document, preferably without closing it.

    Your posts are confusing, to say the least. You say
    wordname.docx will already have been created when opening the workbook
    but then you have code to create it, which implies the document had not already been created. You also say:
    I want the A1:M40 range copied to the wordname.docx, preferably without closing wordname.docx everytime
    But the code you posted has one lot copying that range, but another copying A1:N40. Plus you quit Word - which necessarily closes the document.

    The following code shows how to go about checking if the document is already open and, if not, creating one, then leaving the document open once the data have been pasted into it.
    Please Login or Register  to view this content.
    Cheers,
    Paul Edstein
    [Fmr MS MVP - Word]

  6. #6
    Registered User
    Join Date
    12-02-2017
    Location
    Copenhagen, Denmark
    MS-Off Ver
    2016
    Posts
    55

    Re: Copy bitmap to specific word document, preferably without closing it.

    Yeah, I see that my post is confusing, but as I said I have little experience with the interaction between word and excel.

    In my own reply I got an answer which is actually pretty simple.

    Thanks for the input

  7. #7
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: Copy bitmap to specific word document, preferably without closing it.

    If you study the code I posted, though, you'll see there is no need to activate or select anything in Excel or Word, which makes the code far more efficient.

  8. #8
    Registered User
    Join Date
    12-02-2017
    Location
    Copenhagen, Denmark
    MS-Off Ver
    2016
    Posts
    55

    Re: Copy bitmap to specific word document, preferably without closing it.

    Quote Originally Posted by macropod View Post
    If you study the code I posted, though, you'll see there is no need to activate or select anything in Excel or Word, which makes the code far more efficient.
    Oh, I see now. Thank you

+ 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. Want to Develop a Excel VBA Macro to copy Specific data from a Word Document to Excel
    By nikhild64 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-29-2018, 12:06 AM
  2. Closing A Word Document WIth Excel VBA
    By Jenn68 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 03-28-2017, 05:29 PM
  3. copy cell range as bitmap and paste into document within a database in lotus notes
    By exceliscool in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-29-2013, 06:10 PM
  4. Excel VBA copy specific lines from a Word document (3rd line from top of page)
    By Excelebrate in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-25-2012, 06:02 AM
  5. Excel VBA copy specific lines from a Word document
    By Snoopy2003 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-25-2012, 05:58 AM
  6. Trouble closing MS Word document from Excel macro
    By Cumberland in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-17-2007, 01:00 PM
  7. closing a word document
    By natanz in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-02-2006, 06:35 PM

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