Word mail merge 255 characters

Mike2502

Board Regular
Joined
Jan 19, 2020
Messages
143
Office Version
  1. 2010
Hi all,

I've made the above work however, for my mail merge on word I get an error for 'String is longer than 255 characters'

As this is in a shared drive the path is longer than usual, is there any way around this? I've hid the path links for obvious reasons but see below

VBA Code:
  ActiveDocument.MailMerge.MainDocumentType = wdFormLetters
ActiveDocument.MailMerge.OpenDataSource Name:="linkhere" _
, ConfirmConversions:=False, ReadOnly:=False, LinkToSource:=True, _
AddToRecentFiles:=False, _
WritePasswordDocument:="", Revert:=False, _
Format:=wdOpenFormatAuto, Connection:= _
"Provider=Microsoft.ACE.OLEDB.12.0;User ID=Admin;Data Source=linkhere;Mode=Read;Extended Properties=""HDR=YES;IMEX=1;"";Jet OLEDB:System database="""";Jet OLEDB:Registry Path="""";Jet OLEDB" _
, SQLStatement:="SELECT * FROM `Data$`", SQLStatement1:="", SubType:= _
wdMergeSubTypeAccess
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"
You can try renaming the file/folders names to a shorter ones across the file systems to get rid of the same, if possible.
 
Upvote 0
Try deleting:
VBA Code:
_
,  ConfirmConversions:=False, ReadOnly:=False, LinkToSource:=True, _
AddToRecentFiles:=False, _
WritePasswordDocument:="", Revert:=False
 
Upvote 0
Try deleting:
VBA Code:
_
,  ConfirmConversions:=False, ReadOnly:=False, LinkToSource:=True, _
AddToRecentFiles:=False, _
WritePasswordDocument:="", Revert:=False

Hi Paul

I'm getting the same error on this;

VBA Code:
    ActiveDocument.MailMerge.MainDocumentType = wdFormLetters
    ActiveDocument.MailMerge.OpenDataSource Name:="location", _
        Format:=wdOpenFormatAuto, Connection:= _
        "Provider=Microsoft.ACE.OLEDB.12.0;User ID=Admin;Data Source=location;Mode=Read;Extended Properties=""HDR=YES;IMEX=1;"";Jet OLEDB" _
        , SQLStatement:="SELECT * FROM `PP$`", SubType:= _
        wdMergeSubTypeAccess

Is there anything I can trim out? Or would it work if I made a string with the location and put the string in the 'Location' fields above? If so how would one implement this into the sql?

Thanks!
 
Upvote 0
You might try having your IT people set up an alias for the filepath and use that.
 
Upvote 0

Forum statistics

Threads
1,223,229
Messages
6,170,881
Members
452,364
Latest member
springate

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top