Accessing word from Excel

In Distress

New Member
Joined
Mar 12, 2003
Messages
37
Howdy all,

I find myself once again trapped in the realm of VBA and needing the assistance of the brainstrust that is Mr Excel.

I have found alot of code for my problem, but I can't seem to adapt it to do what I want so.....

Essentially I have an excel file that will access certain formfields in a Word Document and copy those values to a cell reference based on their condition (i.e Checkbox is True or False).

Now, I found alot of code that tells me how to open Word, and how to create a new word document, and also how to open a word document, but nothing that will just go to a word document that I have open!

So..... to simplify matters, lets say I have an excel workbook called "Extract", and a word file called "Survey". Now, let's say I have both of these files open. How do I reference to the word file that I have open? (I don't want Excel to open the file itself through the code) I've tried ActiveDocument, I tried AppActivate, but still to no avail. The word document file name will never change by the way.

I have ruffly 500 surveys coming back to me via email and I don't fancy data inputing every single answer, so please, any assistance to save me some sanity would be fantastic.

Thanks in advance

In Distress.
 

Excel Facts

Back into an answer in Excel
Use Data, What-If Analysis, Goal Seek to find the correct input cell value to reach a desired result
This is the basic code that does either depending on circumstances :-
Code:
    '-----------------------------------------------------
    '- check for Word Application
    On Error Resume Next
    Set WordApp = GetObject(, "Word.Application")
    If Err.Number <> 0 Then ' need to open word
        Set WordApp = CreateObject("Word.Application")
    End If
    On Error GoTo 0
    '-------------------------------------------------------
 
Upvote 0

Forum statistics

Threads
1,203,457
Messages
6,055,546
Members
444,795
Latest member
cjohnson333

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top