D
Dave.Punk.Emo
Ok, I'm trying to open and update a MS Word document from Excel using
VBA, but everytime I try to open it, it loads as a Read Only Document,
giving me the message that this file is locked for use by myself, and
thus not allowing me to save it. I'm using this code to open it (the
SendKeys does not appear to make any difference to this message):
Sub Button13_Click()
Dim wdApp As Object
Dim wdDoc As Object
Dim sFname As String
sFname = "R:\SALES\Quote Generators\Quotes\2 Pass Tray\2 Pass Tray
Quote.doc" 'File Location
If sFname = "R:\SALES\Quote Generators\Quotes\2 Pass Tray\2 Pass
Tray Quote.doc" Then
Set wdApp = CreateObject("Word.Application")
wdApp.Documents.Open Filename:="R:\SALES\Quote Generators
\Quotes\2 Pass Tray\2 Pass Tray Quote.doc" 'Opens File
SendKeys "{Left} {Enter}, False" 'Updates File
End If
End Sub
Can anyone help me to be able to open it as a non-read-only file...?
VBA, but everytime I try to open it, it loads as a Read Only Document,
giving me the message that this file is locked for use by myself, and
thus not allowing me to save it. I'm using this code to open it (the
SendKeys does not appear to make any difference to this message):
Sub Button13_Click()
Dim wdApp As Object
Dim wdDoc As Object
Dim sFname As String
sFname = "R:\SALES\Quote Generators\Quotes\2 Pass Tray\2 Pass Tray
Quote.doc" 'File Location
If sFname = "R:\SALES\Quote Generators\Quotes\2 Pass Tray\2 Pass
Tray Quote.doc" Then
Set wdApp = CreateObject("Word.Application")
wdApp.Documents.Open Filename:="R:\SALES\Quote Generators
\Quotes\2 Pass Tray\2 Pass Tray Quote.doc" 'Opens File
SendKeys "{Left} {Enter}, False" 'Updates File
End If
End Sub
Can anyone help me to be able to open it as a non-read-only file...?