Welcome to the Forum!
![]()
Private Sub CommandButton1_Click() Worksheets("Sheet2").Range("A1").Value = TextBox1.Value 'etc. for others Shell "cmd /c winword " & """" & "X:\MSWord\test.doc" & """", vbNormalFocus Unload Me End Sub
Welcome to the Forum!
![]()
Private Sub CommandButton1_Click() Worksheets("Sheet2").Range("A1").Value = TextBox1.Value 'etc. for others Shell "cmd /c winword " & """" & "X:\MSWord\test.doc" & """", vbNormalFocus Unload Me End Sub
I did a quick trial and while I didn't get any errors nothing seemed to happen.
This is what I have.
What did I enter wrong?![]()
Private Sub CommandButton1_Click() Worksheets("Sheet3").Range("B2").Value = lstName.Value 'etc. for others Shell "cmd /c winword " & """" & "C:\test.txt" & """", vbNormalFocus Unload Me End Sub Private Sub CmdOrder_Click() End Sub
Thanks for the help BTW!
OK, I reentered it as
It works! Thanks a million!![]()
Private Sub CmdOrder_Click() Worksheets("Patient").Range("B2").Value = lstName.Value 'etc. for others Shell "cmd /c winword " & """" & "C:\test.txt" & """", vbNormalFocus Unload Me End Sub
However, I notice the cmd window pops up, is there a way to kill it after it launches the document?
You can hide it.
![]()
Shell "cmd /c winword " & """" & "x:\MSWord\Test.doc" & """", vbHide
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks