Asked by Tocogroup
at 2024-11-30 05:03:35
Point:500 Replies:11 POST_ID:828848USER_ID:11762
Topic:
Microsoft Excel Spreadsheet Software;;Microsoft Word
Hi All,
I have an Excel 2010 VBA application in which I open a Word document and save it with a different filename.
When I close the Word document the 'copied' version is still open. It might be obvious but how do I close this 'Doc' file within my VBA code ?
The code looks like this....
Dim WordApp As Object
Dim WordDoc As Object
WordDoc.Save
WordApp.Documents.Add WordDoc.FullName
WordDoc.SaveAs strDocumentName
MsgBox "Your Word document has been saved as " & strDocumentName, vbInformation
WordDoc.Close
I have an Excel 2010 VBA application in which I open a Word document and save it with a different filename.
When I close the Word document the 'copied' version is still open. It might be obvious but how do I close this 'Doc' file within my VBA code ?
The code looks like this....
Dim WordApp As Object
Dim WordDoc As Object
WordDoc.Save
WordApp.Documents.Add WordDoc.FullName
WordDoc.SaveAs strDocumentName
MsgBox "Your Word document has been saved as " & strDocumentName, vbInformation
WordDoc.Close