Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I found this piece of code by Bob Phillips that opens a Word document from
within an Excel macro. Dim oWord as Object Dim oDoc as Object Set oWord = CreateObject("Word.Application") oWord.Visible = True Set oDoc = oWord.Documents.Open("C:\personal\bob\personal\CV - RP (short).doc") It works fine but it also closes the Excel file that contains the macro. Is there a way to prevent the Excel file from closing? -- russ |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Russ,
There's nothing in that snippet that will close the Excel Application. I think you need to post all your code. Mike "Russ" wrote: I found this piece of code by Bob Phillips that opens a Word document from within an Excel macro. Dim oWord as Object Dim oDoc as Object Set oWord = CreateObject("Word.Application") oWord.Visible = True Set oDoc = oWord.Documents.Open("C:\personal\bob\personal\CV - RP (short).doc") It works fine but it also closes the Excel file that contains the macro. Is there a way to prevent the Excel file from closing? -- russ |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Nothing I can see in that code would cause Excel or the workbook to close.
Lose focus, yes, close, no. At least not in my testing. Gord Dibben MS Excel MVP On Mon, 23 Nov 2009 09:10:02 -0800, Russ wrote: I found this piece of code by Bob Phillips that opens a Word document from within an Excel macro. Dim oWord as Object Dim oDoc as Object Set oWord = CreateObject("Word.Application") oWord.Visible = True Set oDoc = oWord.Documents.Open("C:\personal\bob\personal\CV - RP (short).doc") It works fine but it also closes the Excel file that contains the macro. Is there a way to prevent the Excel file from closing? |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
What version of excel are you using?
Russ wrote: I found this piece of code by Bob Phillips that opens a Word document from within an Excel macro. Dim oWord as Object Dim oDoc as Object Set oWord = CreateObject("Word.Application") oWord.Visible = True Set oDoc = oWord.Documents.Open("C:\personal\bob\personal\CV - RP (short).doc") It works fine but it also closes the Excel file that contains the macro. Is there a way to prevent the Excel file from closing? -- russ -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Need macro that delete rows starting with specified letter/word | Excel Programming | |||
keyboard is locked after starting in both word and excel | Excel Discussion (Misc queries) | |||
Starting Word from Excel | Excel Programming | |||
how to keep a word of same sentence starting w a capital next lin | Excel Worksheet Functions | |||
Starting Excel from Word | Excel Programming |