K
kim
Hi
I have a macro that does a mail merge from an excel 2007 workbook to word-
mailing labels for a mailshot. This is on an XP pro PC.
I have copied it over to run on a Vista machine running Word 2007.
It fails to excute as it can't connect to data source. I re wrote the file
path to the source on the vista machine. and rechecked it several times. Here
is the bit that works on XP:
"C:\Documents and Settings\Fred\My Documents\Friends labels\friends
merge.xls" _
, ConfirmConversions:=False, ReadOnly:=False, LinkToSource:=True, _
AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate:="", _
WritePasswordDocument:="", WritePasswordTemplate:="", Revert:=False, _
Format:=wdOpenFormatAuto, Connection:= _
"Provider=Microsoft.ACE.OLEDB.12.0;User ID=Admin;Data
Source=C:\Documents and Settings\Fred\My Documents\Friends labels\friends
merge.xls;Mode=Read;Extended Properties=""HDR=YES;IMEX=1;"";Jet OLEDB:System
database="""";Jet OLEDB:Registry Path="""";Jet OLEDB:E" _
, SQLStatement:="SELECT * FROM `Friends$`", SQLStatement1:="",
SubType:= _
wdMergeSubTypeAccess
On the vista machine I copy the excel file to C drive andchange code to file
path:
C:\friends merge.xls
I can't understand why it can't connect. It it a vista versus XP issue?
Help appreciated
I have a macro that does a mail merge from an excel 2007 workbook to word-
mailing labels for a mailshot. This is on an XP pro PC.
I have copied it over to run on a Vista machine running Word 2007.
It fails to excute as it can't connect to data source. I re wrote the file
path to the source on the vista machine. and rechecked it several times. Here
is the bit that works on XP:
"C:\Documents and Settings\Fred\My Documents\Friends labels\friends
merge.xls" _
, ConfirmConversions:=False, ReadOnly:=False, LinkToSource:=True, _
AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate:="", _
WritePasswordDocument:="", WritePasswordTemplate:="", Revert:=False, _
Format:=wdOpenFormatAuto, Connection:= _
"Provider=Microsoft.ACE.OLEDB.12.0;User ID=Admin;Data
Source=C:\Documents and Settings\Fred\My Documents\Friends labels\friends
merge.xls;Mode=Read;Extended Properties=""HDR=YES;IMEX=1;"";Jet OLEDB:System
database="""";Jet OLEDB:Registry Path="""";Jet OLEDB:E" _
, SQLStatement:="SELECT * FROM `Friends$`", SQLStatement1:="",
SubType:= _
wdMergeSubTypeAccess
On the vista machine I copy the excel file to C drive andchange code to file
path:
C:\friends merge.xls
I can't understand why it can't connect. It it a vista versus XP issue?
Help appreciated