Stuart - you may need to use DDEInitiate.
eg: ChannelNumber = Application.DDEInitiate( _
app:="WinWord", _
topic:="C:\YOURDOC.DOC")
Application.DDETerminate ChannelNumber
Could be worth a look?
I tried your suggestion, but I get error messages:
1. Remote Data Not Accessible. Start Application WINWORD.EXE? (Yes/No buttons)
2. The document name or path is invalid. Try these suggestions. *Check the file permissions in the document or drive. *Use the file open dialog box to to locate the document (C:\MonthlyPlanner.doc)
(OK Button only)
Before you ask, yes that is the correct file location and name! Any assistance is greatly appreciated. My code now looks as below:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim keyRange As Range
Set keyRange = Range("A1")
If Not Intersect(keyRange, Target) Is Nothing Then
If Target = "True" Then
UserReply = MsgBox("Microsoft Word opening... Do you wish to continue?", vbYesNo)
If UserReply = vbYes Then
ChannelNumber = Application.DDEInitiate( _
app:="WinWord", _
topic:="C:\MonthlyPlanner.doc")
Application.DDETerminate ChannelNumber
Else: End If
Else: End If
End If
End Sub
Hi Stuart,
Give this a go.
Dim WordPath as Variant
Dim WordDoc as Variant
WordPath = "c:\<yourpath>\office\winword.exe"
WordDoc = "c:\yourfile.doc"
Shell WordPath, 6 'This command will open Word NB: the second parameter controls how Word will be opened
Chan = DDEInitiate("WinWord", "System") 'This opens DDE channel
DDEExecute Chan, "[fileopen(" + Chr$(34) + WordDoc + Chr$(34) + ")]" ' This opens your file
' You can do any other word commands here using DDE
DDETerminate Chan ' This will terminate the DDE channel
This code should come after your display of the dialog box
Hope this is better.
L.
That did the job - Thanks Leroy!