• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Excel to Word

Hi Hui,

Hope you doing well,

I am in difficult situation again I need some suggestion to create a word document by vba code.
like If I have three sheet in a workbook and I want to make word doc. for sheet1 with respected existing data and format.

please share your suggestion would be appreciated.

Warm Regards
Nipendra
 
Hi Nipendra

This sort of problem can be tricky with VB on a number of fronts. When you use vb to push data to Word there is almost always a formatting issue. The data never looks the same when you push it in via vba. Trust me I have travelled down that path.

My solution was to do away with vb and create a link to the workbook. Then as your tables, charts change in XL they change in Word as well. The advantage is that you control the format from XL so you get the same format in word as you do in XL.

Copy an excel Table or chart now in Word go Home - Paste Special - Past Link radio button and Microsoft Excel Worksheet Object (for a table) and Microsoft Excel Chart Object for a Chart.

Anyways this is my thoughts on the matter.

Take care

Smallman
 
Thanks Smallman for your prompt response,

and pleasure to here your suggestions,
still generally how we can made that word doc. if leave the format part.
 
Hi Nipendra

Open a fresh instance of word. We are going to call this word document a Template. Now open your Excel file and follow the instructions I have given you above. If you do it properly you can see the results when ever you type data into the XL file it is automatically fed into the word file. I have examples but it would probably be best for me to direct you to a website which explains this sort of thing in more detail.

Ah Bingo - here is a pictorial of what I was trying to describe in Post 2. Follow the instructions and you will have one solution.

http://wordprocessing.about.com/od/workingwithotherprograms/l/blexcellink.htm

Take care

Smallman
 
Back
Top