#1
|
|||
|
|||
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? |
#2
|
||||
|
||||
Hi coconutt,
Your 'error message' image doesn't display, so it's not possible to comment on what the issue might be. If you're still having difficulty, please post back with the actual text of the error message, and tell us which code line (if any) is highlighted.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
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 |
Run-time error '1004': Document not saved. The document may be open... | doctor_who12 | Excel Programming | 1 | 01-22-2014 04:47 PM |
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 |