Automation of importing data from excl to word

  • Hi frnds,
    I have got a small problem for which I need solution
    The description of the problem is like this:


    I have one word file (I m using Office XP) which is a template. In that file I have to change info at some of the places and everytime save it as a different name. The info which I change comes from a separate excel file which contains all the inputs in different columns.


    For example the excel sheet has four columns say name , age ,sex and address.
    In the word file I have to change only these 4 parameters and rest of the content will be common to all the files and save it as say name_age_address.doc .


    Now, I want to automate the process and reduce my efforts to do copy – paste job again and again. It will save my time and reduce the chances of error.
    I want to open the template file and automatically all the changes should be made and the file should be renamed as per the specific format(name_age_address.doc)


    Help needed.
    Thanks in advance

  • Re: Automation of importing data from excl to word


    Hi norie,
    Thanx for the prompt reply
    I am an ametuer in excel and VBA.I tried to follow the link given in ur post but couldn't get much out of it.If possible ,please give me a detailed solution to my problem.Also please elaborate on how we can use mail merge option to export data from differnent cells in xls to different locations in word


    thanks in advance :thanx:

  • Re: Automation of importing data from excl to word


    Thanks Dreamboat
    I tried ur code and its working fine.I havnt yet checked on my actual files but i have got a feeling that it will work perfectly .


    U guys really rock!!

  • Re: Automation of importing data from excl to word


    Dreamboat


    Nice link, but I can't see why the OP can't use mail merge, they indicate that the data in Excel is structured in an acceptable way.

    Boo!:yikes:

  • Re: Automation of importing data from excl to word


    Norie:


    I hear you...


    Here's the deal, and a lot of people want it...


    First, they want to direct from Excel. Sometimes, 'cause that's what they're more comfy with.


    Second, they're only doing one at a time. Mailmerge goes to one data source...you'd have to switch the data source every time if you're, for instance, saving the Excel file each time. Of course, mail merge is great if you're creating multiple documents each time, but not for just one.


    Third, mail merge (I'm sure you know) requires the data in a flat file format. This might not be the desired layout in the Excel file.


    I waited a long time to get the "push merge" code 'cause I constantly kept seeing people asking questions where it would be the perfect answer, but all I'd been able to find was have the code hard-written for each bookmark/named range. This code (you prolly noticed) picks up each named range/bookmark without hard coding.


    And it'd be nice, right? to be able to just hit Submit from the Excel file and launch a mail merge to it...okay, that might be codeable, but you can't merge to an open Excel file!


    It takes more preparation, but not all that much more than a mail merge. It's good for people who want to create quotes from data they calculate in Excel.


    :) Hope that helps.

  • Re: Automation of importing data from excl to word


    >>>Third, mail merge (I'm sure you know) requires the data in a flat file format.


    Doh! I see you said that, Norie. :)

  • Re: Automation of importing data from excl to word


    Anne


    Actually in the past I used to use similar code to that of your link to create various standard letters in Word using data from forms in Access.


    Some of the content of the letter would vary according to the data and/or user choices eg 1st reminder letter, 2nd etc


    Also each letter had to be named according to a standard convention and saved in a particular folder.

    Boo!:yikes:

  • Re: Automation of importing data from excl to word


    Right... :)


    Now... why didn't I get a notif of your post? Guess I gotta check my options again.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!