Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to open a word document from excel
Can anyone help please,I am looking for a macro that will open a word
template based upon a 'Y' or 'N' answer in an excel column (column G). Can this be done? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to open a word document from excel
If Range("H1").Value = "Y" Then
Set oWordApp = CreateObject("Word.Application") Set oDoc = oWordApp.Documents.Open("C:\personal\bob\doc1.doc" ) 'do something Set oDoc = Nothing oWordApp.Quit Set oWordApp = Nothing End If -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "MarkC" wrote in message ... Can anyone help please,I am looking for a macro that will open a word template based upon a 'Y' or 'N' answer in an excel column (column G). Can this be done? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to open a word document from excel
How does this work if there is a N in the column, as that will have to open
the other word doc...sorry should have explained this more...Thanks for the reply. "Bob Phillips" wrote: If Range("H1").Value = "Y" Then Set oWordApp = CreateObject("Word.Application") Set oDoc = oWordApp.Documents.Open("C:\personal\bob\doc1.doc" ) 'do something Set oDoc = Nothing oWordApp.Quit Set oWordApp = Nothing End If -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "MarkC" wrote in message ... Can anyone help please,I am looking for a macro that will open a word template based upon a 'Y' or 'N' answer in an excel column (column G). Can this be done? |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to open a word document from excel
Just change the logic to do the test before the documents open in a simple
If ... Else test. -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "MarkC" wrote in message ... How does this work if there is a N in the column, as that will have to open the other word doc...sorry should have explained this more...Thanks for the reply. "Bob Phillips" wrote: If Range("H1").Value = "Y" Then Set oWordApp = CreateObject("Word.Application") Set oDoc = oWordApp.Documents.Open("C:\personal\bob\doc1.doc" ) 'do something Set oDoc = Nothing oWordApp.Quit Set oWordApp = Nothing End If -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "MarkC" wrote in message ... Can anyone help please,I am looking for a macro that will open a word template based upon a 'Y' or 'N' answer in an excel column (column G). Can this be done? |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to open a word document from excel
Hi, my VBA knowledge is non existent!! How do I do that ?
"Bob Phillips" wrote: Just change the logic to do the test before the documents open in a simple If ... Else test. -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "MarkC" wrote in message ... How does this work if there is a N in the column, as that will have to open the other word doc...sorry should have explained this more...Thanks for the reply. "Bob Phillips" wrote: If Range("H1").Value = "Y" Then Set oWordApp = CreateObject("Word.Application") Set oDoc = oWordApp.Documents.Open("C:\personal\bob\doc1.doc" ) 'do something Set oDoc = Nothing oWordApp.Quit Set oWordApp = Nothing End If -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "MarkC" wrote in message ... Can anyone help please,I am looking for a macro that will open a word template based upon a 'Y' or 'N' answer in an excel column (column G). Can this be done? |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to open a word document from excel
Set oWordApp = CreateObject("Word.Application")
If Range("H1").Value = "Y" Then Set oDoc = oWordApp.Documents.Open("C:\personal\bob\doc1.doc" ) Else Set oDoc = oWordApp.Documents.Open("C:\personal\jim\another.d oc") End If 'do something Set oDoc = Nothing oWordApp.Quit Set oWordApp = Nothing If your VBA is non-existent, what will you do with the doc when it is opened? -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "MarkC" wrote in message ... Hi, my VBA knowledge is non existent!! How do I do that ? "Bob Phillips" wrote: Just change the logic to do the test before the documents open in a simple If ... Else test. -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "MarkC" wrote in message ... How does this work if there is a N in the column, as that will have to open the other word doc...sorry should have explained this more...Thanks for the reply. "Bob Phillips" wrote: If Range("H1").Value = "Y" Then Set oWordApp = CreateObject("Word.Application") Set oDoc = oWordApp.Documents.Open("C:\personal\bob\doc1.doc" ) 'do something Set oDoc = Nothing oWordApp.Quit Set oWordApp = Nothing End If -- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "MarkC" wrote in message ... Can anyone help please,I am looking for a macro that will open a word template based upon a 'Y' or 'N' answer in an excel column (column G). Can this be done? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
excel trying to open word document | Excel Discussion (Misc queries) | |||
what happens if I open an excel document in word? | Excel Discussion (Misc queries) | |||
Open a specific Word document from an Excel Macro | Excel Programming | |||
macro and button to open a word document from within excel | Excel Programming | |||
open a word document in excel | Excel Programming |