I'm trying to execute a Mailmerge from Publisher using Excel 2007 as the DataSource.
How do I specify the SheetName that I want to use in Excel ?
The workbook is PUBLISHERLINK.xls & the workSheet is EntrySheet .
When I run this code, it doesn't actually execute the merge, but after I close & re-open the page, Sometimes, the data is inserted correctly. Sometimes, there's nothing in there.
How can I fill in the data correctly on the Publisher page.
Public Sub FirstTime()
Dim oExcel As Object
Dim PATH, SOURCE As String
Set oExcel = CreateObject("Excel.Application")
PATH = ThisDocument.PATH 'determine current directory
ActiveDocument.MailMerge.OpenDataSource _
bstrDataSource:=PATH & "\PUBLISHERLINK.xls", _
bstrTable:="EntrySheet$", _
fNeverPrompt:=True, fOpenExclusive:=True
'Perform the merge.
ActiveDocument.MailMerge.Execute True, pbMergeToExistingPublication
End Sub