Consulting

Results 1 to 9 of 9

Thread: excel to work passing data dynamically with bookmarks in word

  1. #1

    excel to work passing data dynamically with bookmarks in word

    BODY { MARGIN: 8px } .LW-yrriRe { FONT: x-small arial } HI All,

    How are you doing.I have requirement to carry values from Excel to Word not copy & paste but carry individual values and place it Word in desired location. I am able to do copy and paste the values from excel to word but not to the desire place

    I have created .DOT file and bookmark as well in template file and excuted script from excel it's not working. I have attached the files. I highly apprecite gurus help. I see light at the end of the tunnel. Thanks to you all

    Thanks in advance

    Cheers
    Sekhar

  2. #2
    VBAX Tutor lynnnow's Avatar
    Joined
    Jan 2005
    Location
    Mumbai, Maharashtra, India
    Posts
    299
    Location
    Sekhar, why don't you consider using mail merge?

    Lincoln

  3. #3
    Thanks for the lightning reply. Actually I am new to VBA, I have seen some posting I have followed it nothing beyond then that..All my application demands is dyanmic insert into Word from Excel where data will be place in Word in desire location

    I appreciate if you have any example from Excel to Word. It would be life saver.Thanks in advance

    cheers
    sekhar

  4. #4
    VBAX Regular
    Joined
    Jun 2005
    Posts
    51
    Location
    Sekhar, have a look at Ken Puls' Knowledge Base article on Pushing Excel Named Range Values To Bookmarks in Word...

    http://www.vbaexpress.com/kb/getarticle.php?kb_id=381

  5. #5
    HI Dragon, Thanks a billion. I was working the code and there is error called "Error: 5151 There is a problem"..i was trying to work the error but with failed attempt.appreciate your help
    thanks once again
    cheers

  6. #6
    VBAX Tutor lynnnow's Avatar
    Joined
    Jan 2005
    Location
    Mumbai, Maharashtra, India
    Posts
    299
    Location
    Chandrashekar,

    Please answer these questions:

    1. Did you create ranges with names in Excel?
    2. Did you use the named ranges from Excel for bookmarks created in Word?
    3. Did you edit the Word template name to suit your preference?

    These answers are necessary to understand where the fault is. Since the KB code is a working example, you may not have followed it to the T and hence the error.

    Lincoln

  7. #7
    VBAX Regular
    Joined
    Jun 2005
    Posts
    51
    Location
    In addition to lynnow's questions, what version of Excel are you using?

  8. #8
    hi,

    Thanks for the response.I have changed the code here and there it's working but I am unable to transfer the code to only sheet1 but i would to fetch the data from sheet2 and sheet3 and so on

    - I am using Office 2007
    - (1)I am new to VBA not sure I may not be giving correct answer. all my ranges were given in code only I guess
    -(2)I have created bookmarks in excel
    -(3) I am not sure how to to edit template(.dot)file when ever I edit the template it doesn't allow to save me

    Thanks in advance
    Sekhar

  9. #9
    VBAX Regular
    Joined
    Jun 2005
    Posts
    51
    Location
    I only have Office 2003. However, I think the issue is that you have not created any named ranges. You seem to be referencing the actual range addresses in Excel instead.

    Create the named ranges (by clicking on Insert, Name, Define whilst in Excel). Once the ranges are defined, VBA should be able to use them regardless of which sheet they are on.

    3. Not sure what the problem is. You should be able to save the .dot file by doing File Save As, and choosing the Save As Type as Document Template (*.dot)

Posting Permissions

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