View Single Post
 
Old 06-08-2012, 07:20 AM
coconutt coconutt is offline Windows XP Office 2007
Novice
 
Join Date: May 2012
Posts: 10
coconutt is on a distinguished road
Default macro to open another document

Hello, I have a macro that i execute within the document to open another word docx. When I exit the document i get this error.


Sub OPENBARCODE()
'
' OPENBARCODE Macro
'
'
Dim WordApp As Object
Dim WordDoc As Object

Set WordApp = CreateObject("Word.Application")
Set WordDoc = WordApp.Documents.Open(FileName:="C:\Documents and Settings\Administrator\Desktop\sMD1.docx")
WordApp.Visible = True

Set WordDoc = Nothing
Set WordApp = Nothing

End Sub
Any thoughts?
Reply With Quote