Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #16  
Old 08-13-2018, 11:55 PM
ganesang ganesang is offline Need macro to fill the values in msword based on the excel sheet info Windows XP Need macro to fill the values in msword based on the excel sheet info Office 2016
Competent Performer
Need macro to fill the values in msword based on the excel sheet info
 
Join Date: Jul 2018
Posts: 171
ganesang is on a distinguished road
Default

I am just tried in the word before but i had the error report and highlighted third line.

So that i am using this macro in to the excel.

Anyway i have attached the error. Please advise.
Attached Images
File Type: png Error.png (147.0 KB, 17 views)
Reply With Quote
  #17  
Old 08-13-2018, 11:56 PM
macropod's Avatar
macropod macropod is offline Need macro to fill the values in msword based on the excel sheet info Windows 7 64bit Need macro to fill the values in msword based on the excel sheet info Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

And did you added the required Excel reference - as set out in the Note above?
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #18  
Old 08-14-2018, 12:03 AM
ganesang ganesang is offline Need macro to fill the values in msword based on the excel sheet info Windows XP Need macro to fill the values in msword based on the excel sheet info Office 2016
Competent Performer
Need macro to fill the values in msword based on the excel sheet info
 
Join Date: Jul 2018
Posts: 171
ganesang is on a distinguished road
Default

I am not able to find such as "Excel object Model" via tools|references|available references.

Can you please tell me the exact reference name?
Attached Images
File Type: png Tools.png (167.0 KB, 17 views)
Reply With Quote
  #19  
Old 08-14-2018, 12:06 AM
macropod's Avatar
macropod macropod is offline Need macro to fill the values in msword based on the excel sheet info Windows 7 64bit Need macro to fill the values in msword based on the excel sheet info Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Except for the active ones, the references are sorted alphabetically. The one you're looking for is the Microsoft Excel 16.0 Object Library, as per post 10.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #20  
Old 08-14-2018, 12:13 AM
ganesang ganesang is offline Need macro to fill the values in msword based on the excel sheet info Windows XP Need macro to fill the values in msword based on the excel sheet info Office 2016
Competent Performer
Need macro to fill the values in msword based on the excel sheet info
 
Join Date: Jul 2018
Posts: 171
ganesang is on a distinguished road
Default

Yes!! I got it

But the excel path is default per code (C:/) or we can able to modify as in the same folder? Currently i have the error message as per code.
Reply With Quote
  #21  
Old 08-14-2018, 12:37 AM
macropod's Avatar
macropod macropod is offline Need macro to fill the values in msword based on the excel sheet info Windows 7 64bit Need macro to fill the values in msword based on the excel sheet info Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

The macro already looks in the same folder - for your 'Data to fill.xlsx' workbook.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #22  
Old 08-14-2018, 01:48 AM
ganesang ganesang is offline Need macro to fill the values in msword based on the excel sheet info Windows XP Need macro to fill the values in msword based on the excel sheet info Office 2016
Competent Performer
Need macro to fill the values in msword based on the excel sheet info
 
Join Date: Jul 2018
Posts: 171
ganesang is on a distinguished road
Default

Error attached...

Please check
Attached Images
File Type: png error.png (157.7 KB, 19 views)
Reply With Quote
  #23  
Old 08-14-2018, 02:46 AM
ganesang ganesang is offline Need macro to fill the values in msword based on the excel sheet info Windows XP Need macro to fill the values in msword based on the excel sheet info Office 2016
Competent Performer
Need macro to fill the values in msword based on the excel sheet info
 
Join Date: Jul 2018
Posts: 171
ganesang is on a distinguished road
Default

Hi Paul!!

Now i can able to run the macro after remove the content "ThisDocument"

I will let you know if anything further!!!

Fantastic work!!!
Reply With Quote
  #24  
Old 08-14-2018, 02:49 AM
macropod's Avatar
macropod macropod is offline Need macro to fill the values in msword based on the excel sheet info Windows 7 64bit Need macro to fill the values in msword based on the excel sheet info Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Evidently, either:
• the document you've added the macro to has never been saved; or
• you've added the macro to a document template and you're trying to run it from that instead of from a document created from the template.
If running the code from a document attached to a template, change 'ThisDocument' to 'ActiveDocument'.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #25  
Old 08-14-2018, 02:55 AM
ganesang ganesang is offline Need macro to fill the values in msword based on the excel sheet info Windows XP Need macro to fill the values in msword based on the excel sheet info Office 2016
Competent Performer
Need macro to fill the values in msword based on the excel sheet info
 
Join Date: Jul 2018
Posts: 171
ganesang is on a distinguished road
Default

Yes got it!!

Is there any other way to select from drop-down control values based on the workbook?

For ex: IF WB=Esy, then Word=1-Easy

Because they given the data in excel sheet like that...
Reply With Quote
  #26  
Old 08-14-2018, 03:01 AM
macropod's Avatar
macropod macropod is offline Need macro to fill the values in msword based on the excel sheet info Windows 7 64bit Need macro to fill the values in msword based on the excel sheet info Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

I already addressed that in post 8: https://www.msofficeforums.com/word-...tml#post132074
Why don't you correct the workbook, via Find/Replace? Coding around this seems to be a lot of unnecessary work.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #27  
Old 08-14-2018, 03:03 AM
ganesang ganesang is offline Need macro to fill the values in msword based on the excel sheet info Windows XP Need macro to fill the values in msword based on the excel sheet info Office 2016
Competent Performer
Need macro to fill the values in msword based on the excel sheet info
 
Join Date: Jul 2018
Posts: 171
ganesang is on a distinguished road
Default

Yes Paul

I read that, but i just wanted to know that the reason of curiosity!!!

Also the workbook they provided has been may protected.
Reply With Quote
  #28  
Old 08-14-2018, 03:59 AM
ganesang ganesang is offline Need macro to fill the values in msword based on the excel sheet info Windows XP Need macro to fill the values in msword based on the excel sheet info Office 2016
Competent Performer
Need macro to fill the values in msword based on the excel sheet info
 
Join Date: Jul 2018
Posts: 171
ganesang is on a distinguished road
Default

If in word document sometimes have tables row rage may vary.

What we do in this case?

for ex: some of the tables have the PV in row 10 etc.
Reply With Quote
  #29  
Old 08-14-2018, 02:36 PM
macropod's Avatar
macropod macropod is offline Need macro to fill the values in msword based on the excel sheet info Windows 7 64bit Need macro to fill the values in msword based on the excel sheet info Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

So what else haven't you told me about the table structures? The only examples you gave all had the PV is the same row & column. It seems I wasted my time coding for something that isn't representative of what you actually have.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #30  
Old 08-15-2018, 10:11 PM
ganesang ganesang is offline Need macro to fill the values in msword based on the excel sheet info Windows XP Need macro to fill the values in msword based on the excel sheet info Office 2016
Competent Performer
Need macro to fill the values in msword based on the excel sheet info
 
Join Date: Jul 2018
Posts: 171
ganesang is on a distinguished road
Default

Hi Paul

Really Sorry for that...

I just realized that the row is dynamic positions. And i am not sure you will be created the macro based on the cell ranges.

All the values of cell rage pulled from the excel is dynamic..

Sorry once again!!
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Need macro to fill data from different sheets based on selected item from drop down skorasika Excel Programming 1 03-13-2015 11:25 AM
Newbie to excel for starters, needing to transfer info from sheet2 to universe sheet. rogcar75 Excel 0 08-12-2014 07:21 AM
Color-fill a range of cells, based on text in a different sheet. Possible? unittwentyfive Excel 2 06-01-2014 06:48 AM
Need macro to fill the values in msword based on the excel sheet info link conditional info in word based on excel list stijnvanhoof Mail Merge 1 11-13-2012 01:55 PM
Need macro to fill the values in msword based on the excel sheet info Open Word w Excel & fill Word textboxes w info from Excel fields runtime error 4248 Joe Patrick Word VBA 2 01-30-2012 07:23 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:13 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft