I have created a macro that uses an Excel spreadsheet to merge many
Excel files together. The spreadsheet has file name and location
information. I want to do the same for many Word documants. Currently
I have a Word macro that simply creates a new word document then just
adds and formats all the required documents.
What I want to do is add another tab on the Excel spreadsheet and have
all of the file name and location information for the Word documents
there and have Excel create the Word document. I have taken some code
from another post and it seems to almost work...
Dim wrdAPPnew As Word.Application
Dim wrdDOCnew As Word.Document
Set wrdAPPnew = CreateObject("Word.Application")
wrdAPPnew.Visible = True
With wrdDOCnew
.
.
.
Selection.InsertFile Filename:=currentInsertFileName, Range:="",
_
ConfirmConversions:=False, Link:=False, Attachment:=False
.
.
.
End With
The "Selection.InsertFile..." command works fine while inside Word but
not from within Excel even though I have referenced the "Microsoft
Word 10.0 Object Library". When run I get a Run-time error 438, object
doesn't support this property or method.
Any ideas are appreciated
Alan Parekh