Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
New to the usergroup. Question: I'm trying to create an excel macro that will pickup filename from a spreadsheet and open the file in Words document, then do more formatting changes to the document. I seems to be stuck at trying to open a Words document from an excel macro. Any thoughts? Thanks in advance. Isham *** Sent via Developersdex http://www.developersdex.com *** |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try this... You need to reference your project to the "Microsoft Word ?.?
Object Library". In the VB Editor select Tools - References ... Sub OpenWordDoc() Dim appWord As Word.Application Set appWord = New Word.Application With appWord .Visible = True .Documents.Open "D:\Test.doc" End With Set appWord = Nothing End Sub -- HTH... Jim Thomlinson "Isham Hamin" wrote: Hi, New to the usergroup. Question: I'm trying to create an excel macro that will pickup filename from a spreadsheet and open the file in Words document, then do more formatting changes to the document. I seems to be stuck at trying to open a Words document from an excel macro. Any thoughts? Thanks in advance. Isham *** Sent via Developersdex http://www.developersdex.com *** |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In A1 put, for example:
C:\third.doc actually the path and filename of any Word doc. Then enter and run this small macro: Sub macro2() Dim s As String Dim ss As String Dim sss As String ss = "cmd.exe /c " s = Cells(1, 1).Value sss = ss & s x = Shell(sss, 1) End Sub You will be in control in Word. -- Gary's Student "Isham Hamin" wrote: Hi, New to the usergroup. Question: I'm trying to create an excel macro that will pickup filename from a spreadsheet and open the file in Words document, then do more formatting changes to the document. I seems to be stuck at trying to open a Words document from an excel macro. Any thoughts? Thanks in advance. Isham *** Sent via Developersdex http://www.developersdex.com *** |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Open Excel file from VB and open MACRO | Excel Discussion (Misc queries) | |||
open up an excel program with an auto open macro | Excel Programming | |||
Macro - Open Word with Excel macro | Excel Discussion (Misc queries) | |||
ASP: Open Excel File with Macro, Allow Macro to run, and then save | Excel Programming | |||
Macro to transfer info from Excel to Words envelope Dialog box. | Excel Programming |