Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
kim kim is offline
external usenet poster
 
Posts: 183
Default Mail merge macro from xp to vista

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
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Mail merge macro from xp to vista

1. Have you made the registry change described in
http://support.microsoft.com/kb/825765/en-us on both machines?

2. Can we assume that you are changing the path in both the Name and
Connection parameters? (FWIW, in this case I think you should be able to do
just

yourobjname.MailMerge.OpenDataSource _
Name:="C:\Documents and Settings\Fred\My Documents\Friends labels\friends
merge.xls", _
SQLStatement:="SELECT * FROM `Friends$`"

or

yourobjname.MailMerge.OpenDataSource _
Name:="C:\friends merge.xls", _
SQLStatement:="SELECT * FROM `Friends$`"

and omit all the other parameters)
--
Peter Jamieson
http://tips.pjmsn.me.uk

"kim" wrote in message
...
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


  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default Mail merge macro from xp to vista

The root folder of the C: drive is probably not available to code when
running Vista. Try moving the folder to c:\ProgramData

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
"kim" wrote in message
...
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


Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mail Merge after upgrading to vista Kathy Mailmerge 4 November 16th 08 06:42 PM
Word 2007 Vista - Email Mail Merge with Attachments Emaleth Mailmerge 1 August 7th 08 01:04 AM
date problems with mail merge and vista Hilly Mailmerge 1 July 11th 08 01:40 AM
using Vista Windows Contacts in Word 2003 mail merge Eileen M[_2_] Mailmerge 1 November 16th 07 05:37 PM
Local version of Excel file used for mail merge in Word 07 on Vista ? Ciegalo Mailmerge 2 October 23rd 07 04:04 PM


All times are GMT +1. The time now is 12:46 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"