Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #5  
Old 11-10-2013, 09:30 PM
macropod's Avatar
macropod macropod is offline Transfering data fields from Word to Excel (2007) Windows 7 32bit Transfering data fields from Word to Excel (2007) Office 2010 32bit
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

Hi Chuck,

For some code to transfer form content from Word to Excel, see:
http://www.vbaexpress.com/forum/show...el-spreadsheet
Note that, although the primary macro there is for exporting content control data, my last post in that thread shows how to modify the code to work with formfields instead. The other important difference is that the code there is intended to be added to an Excel workbook and run on demand, rather than when a particular formfield is updated.

The problem with adding the code to a Word document (or its template) and triggering its execution from Word is that you then need to have extra checks to make sure all the required fields have been completed; otherwise, simply triggering the macro could lead to empty or partially-complete records in Excel. Even with that controlled you could still end up with duplicate records in Excel. Plus, even without the above considerations, the code to do this from Word is considerably more complicated, due to the need to check things like whether the destination workbook is already in use.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Transfering data fields from Word to Excel (2007) [Excel 2007] Building Power Point Slides from data in an Excel Table bremen22 Excel Programming 1 08-07-2013 11:01 AM
Transfering data fields from Word to Excel (2007) 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
Transfering data fields from Word to Excel (2007) Excel 2007 and data in dd:hh:mm:ss format Sammael Excel 6 11-05-2011 06:52 AM
Transfering data fields from Word to Excel (2007) Excel 2007 data question Paul-NYS Excel 3 09-26-2011 10:49 PM
How do I set up the fields in mail merge word 07 from my data base mbcrabber Mail Merge 4 06-06-2010 01:25 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 11:20 AM.


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