G
Greg Maxey
I recently shared an AddIn with a friend and he told me that he was getting
an error with the AddIn if he had an instance of Word open (with the AddIn
loaded) and then attempted to open a second instance of Word from a
different Application.
I was able to duplicate his error by putting my AddIn in Word's Startup
folder. Opening an instance of Word. Then opening another Office applicatio
(e.g., Excel) and running the following code (note a Reference to the Word
Object library must be set up in Exce).
Sub Perplexed()
Dim wdApp As Word.Application
Dim wdDoc As Word.Document
Set wdApp = CreateObject("Word.Application")
Set wdDoc = wdApp.Documents.Add
wdDoc.Content.InsertAfter "Text, Text, Text"
wdApp.Visible = True 'End Sub
A message appears titled "File In Use"
"Addin Name" is locked for editing by "Gregory K. Maxey"
and provides choices for continuing.
Regardless of choice taken, a second instace of Word is opened but there is
no Ribbon or other screen features.
Looking into this further, I noticed that any AddIn with the dotm extention
would cause the same problem. My Addin created with from older .dot
templates do not cause this issus.
Any ideas as to why this occurs?
Thanks.
an error with the AddIn if he had an instance of Word open (with the AddIn
loaded) and then attempted to open a second instance of Word from a
different Application.
I was able to duplicate his error by putting my AddIn in Word's Startup
folder. Opening an instance of Word. Then opening another Office applicatio
(e.g., Excel) and running the following code (note a Reference to the Word
Object library must be set up in Exce).
Sub Perplexed()
Dim wdApp As Word.Application
Dim wdDoc As Word.Document
Set wdApp = CreateObject("Word.Application")
Set wdDoc = wdApp.Documents.Add
wdDoc.Content.InsertAfter "Text, Text, Text"
wdApp.Visible = True 'End Sub
A message appears titled "File In Use"
"Addin Name" is locked for editing by "Gregory K. Maxey"
and provides choices for continuing.
Regardless of choice taken, a second instace of Word is opened but there is
no Ribbon or other screen features.
Looking into this further, I noticed that any AddIn with the dotm extention
would cause the same problem. My Addin created with from older .dot
templates do not cause this issus.
Any ideas as to why this occurs?
Thanks.