Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 02-09-2021, 03:11 AM
macropod's Avatar
macropod macropod is offline How to add date from excel to word document header? Windows 10 How to add date from excel to word document header? Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
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

Well, if it's always the same Excel cell and same Word document - as your code implies - you don't need VBA at all. All you need to do is to set up an OLE link That's as simple as copying the Excel cell, switching to Word, selecting the destination and choosing Edit|Paste Special, with the 'paste link' option and choosing a suitable paste format. Done. From now on, the Word document will update to reflect any changes to the Excel cell.

PS: The error is because you're trying to use a named constant with late binding. You need to either:
• use early binding;
• define that constant; or
• substitute the name with its value.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Extract Document ID and description from header in multiple Word documents and paste in new word doc venkat_m Word VBA 2 05-23-2020 03:57 AM
How to add date from excel to word document header? Calculate week in Word document based on date entered into same document ArviLaanemets Word VBA 4 11-18-2019 12:25 AM
Document attached to Word Header MidgesMom Word 0 11-13-2018 10:58 AM
Convert csv document to excel, format date coba Excel Programming 3 01-07-2016 04:18 AM
How to add date from excel to word document header? word 2007 - Inserting value in the document header chamdan Word VBA 7 11-15-2013 05:06 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:34 PM.


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