Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 06-08-2012, 07:20 AM
coconutt coconutt is offline macro to open another document Windows XP macro to open another document Office 2007
Novice
macro to open another document
 
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
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
macro to open another document Macro to Open to a Website When No Document Is Open lostinwebspace Word VBA 1 02-13-2016 10:28 AM
Save As Macro using first line of document as document name redzan Word VBA 1 01-31-2015 09:24 PM
macro to open another document Run-time error '1004': Document not saved. The document may be open... doctor_who12 Excel Programming 1 01-22-2014 04:47 PM
macro to open another document can I run a macro when I open a specific doc ?? ximpostor Word VBA 10 10-12-2012 12:35 PM
can I run a macro when I open a specific doc. shreked Word 8 01-12-2012 03:36 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 08:52 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft