MailMerge - Select table Form

J

jouj

Dear all,
I'm using this code to attach a data source to the specified document:
====================================================
Dim wrd As New Word.Application
Dim dc As Word.Document
Set dc = wrd.Application.Documents.Open(TemplatePath, ReadOnly:=True)

wrd.Application.Documents(1).Activate
dc.MailMerge.MainDocumentType = wdCatalog
dc.MailMerge.OpenDataSource CurDir & "\ExcelFile.xls" ', ReadOnly:=True,
Connection:="Sheetname$"
etc...
====================================================
Where Sheetname is the ExcelFile.xls sheet name that I want to merge in the
doc file.
but everytime a prompt form appears and asks to [Select Table] and I choose
[Sheetname$].

How can I bypass this Form (Select Table)? Am I missing something?

Thank you.
jouj.
 
Top