Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-09-2014, 01:43 PM
BobBridges's Avatar
BobBridges BobBridges is offline Inserting a Word Module into excel Windows 7 64bit Inserting a Word Module into excel Office 2010 32bit
Expert
 
Join Date: May 2013
Location: USA
Posts: 700
BobBridges has a spectacular aura aboutBobBridges has a spectacular aura about
Default


SarahBear, you may need to be more explicit but maybe not: The good news is that a Word module is an Excel module. That is, the code in both is the same.

Ok, now that I've been all exuberant I guess I should tone it back some. There is a difference, but only in a way. Here's the claim phrased more cautiously: Both are written in VBA, and it's possible to write VBA code that can be transfered directly from one Office product to another and run without any changes whatsoever.

The big difference, maybe the only difference, is that a VBA program running in Excel is subject to different default assumptions than the one in Word. For instance, in an VBA/Excel program when I refer to the Application object, it assumes of course that I mean the Excel Application; equally of course, Word would assume I mean the Word Application. But it's perfectly possible to write code—I occasionally write code myself—that executes in Excel and interacts with Excel objects but also opens the Word Application and pulls data from or writes data to Word.

Now, I write for Excel and Access more often than Word, so every time I want to (for example) export Excel data to Word, I have to work at it to remember how the Word object works. I went to find a bit of sample code just now, intending to demonstrate the process, but it isn't where I expected to find it; I don't think I lost it, just misplaced it. But I've done it a few times, and maybe the above is all you need in order to do it for yourself. If not, ask more questions and I'll work on it with you; I need more practice at it anyway.
Reply With Quote
  #2  
Old 06-10-2014, 06:05 AM
SarahBear SarahBear is offline Inserting a Word Module into excel Windows 7 32bit Inserting a Word Module into excel Office 2010 32bit
Novice
Inserting a Word Module into excel
 
Join Date: Jun 2014
Posts: 13
SarahBear is on a distinguished road
Default

BobBridges, Thanks so much for your help! Unfortunately I am not very familiar with VBA. Although I have begun the process of learning it, at this point I can't do much more than open the visual basics window.

Everything you said made sense to me, I just don't have the skills at this point to apply it. Can you elaborate more on how to actually transfer the code or maybe write the code in excel to automatically open and use word? Idealy I would like to be able to enter information into a single cell on excel and then have excel automaticaly use word to process the data into parts and send it back into the excel sheet to appear in a column.

Hopefully I've correctly understood your response, and I appreciate the help!
Reply With Quote
  #3  
Old 06-10-2014, 06:15 AM
BobBridges's Avatar
BobBridges BobBridges is offline Inserting a Word Module into excel Windows 7 64bit Inserting a Word Module into excel Office 2010 32bit
Expert
 
Join Date: May 2013
Location: USA
Posts: 700
BobBridges has a spectacular aura aboutBobBridges has a spectacular aura about
Default

Let's up a moment, just to be sure I didn't misunderstand you: You said (right?) that you've created a macro in Word to do what you want, and you'd like to use the same code in Excel if possible? Because if so, then you've already figured out at least a little about VBA, right?

I can walk you through writing code in VBA; there are things in life that scare me, but teaching isn't one of them. And it doesn't worry me that you don't know much yet. But where did this macro in Word come from, if you didn't write it yourself?
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Inserting a Word Module into excel Inserting text from one word file into another based on an excel input jmaxcy Excel 14 11-01-2013 04:07 PM
Inserting text from one word file into another based on an excel input jmaxcy Word 3 11-01-2013 01:26 AM
AZWizard Module - ?hidden module pcaldwell Word 1 08-22-2012 01:19 PM
Inserting a Word Module into excel Inserting excel spreadsheet into word doc educpara58 Excel 2 07-28-2011 01:22 AM
bad module "Italian Grammar" crashes Word townsend0406 Word 0 04-20-2009 11:04 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:50 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