l KAUTION l
Board Regular
- Joined
- Nov 3, 2005
- Messages
- 90
I have been searching for an answer to this question, but have failed to find one.
I'm getting Run-time error '4198': Command failed while trying to run this code.
wrd.ActiveDocument.MailMerge.OpenDataSource Name:= _
"O:\Xerox\Conversions\Heacock\ReminderLetters 122909.xls" _
, ConfirmConversions:=False, ReadOnly:=False, LinkToSource:=True, _
AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate:="", _
WritePasswordDocument:="", WritePasswordTemplate:="", Revert:=False, _
Format:=wdOpenFormatAuto, Connection:= _
"Provider=Microsoft.Jet.OLEDB.4.0;Password="""";User ID=Admin;Data Source=O:\Xerox\Conversions\Heacock\ReminderLetters 122909.xls;Mode=Read;Extended Properties=""HDR=YES;IMEX=1;"";Jet OLEDB:System database="""";Jet OLEDB:Regi" _
, SQLStatement:="SELECT * FROM `Sheet2$`", SQLStatement1:="", _
SubType:=wdMergeSubTypeAccess
I'm basically trying to do a mail merge through vba. Similiar code works on a different spreadsheet I've created. The following code is prior to the code above:
Dim wrd As Object
Set wrd = CreateObject("Word.Application")
wrd.Visible = True
wrd.Documents.Open Filename:="O:\Xerox\Conversions\Heacock\Heacock 15 day reminder notice for offers UPDATED 101209.doc"
I would greatly appreciate any help with this!
I'm getting Run-time error '4198': Command failed while trying to run this code.
wrd.ActiveDocument.MailMerge.OpenDataSource Name:= _
"O:\Xerox\Conversions\Heacock\ReminderLetters 122909.xls" _
, ConfirmConversions:=False, ReadOnly:=False, LinkToSource:=True, _
AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate:="", _
WritePasswordDocument:="", WritePasswordTemplate:="", Revert:=False, _
Format:=wdOpenFormatAuto, Connection:= _
"Provider=Microsoft.Jet.OLEDB.4.0;Password="""";User ID=Admin;Data Source=O:\Xerox\Conversions\Heacock\ReminderLetters 122909.xls;Mode=Read;Extended Properties=""HDR=YES;IMEX=1;"";Jet OLEDB:System database="""";Jet OLEDB:Regi" _
, SQLStatement:="SELECT * FROM `Sheet2$`", SQLStatement1:="", _
SubType:=wdMergeSubTypeAccess
I'm basically trying to do a mail merge through vba. Similiar code works on a different spreadsheet I've created. The following code is prior to the code above:
Dim wrd As Object
Set wrd = CreateObject("Word.Application")
wrd.Visible = True
wrd.Documents.Open Filename:="O:\Xerox\Conversions\Heacock\Heacock 15 day reminder notice for offers UPDATED 101209.doc"
I would greatly appreciate any help with this!