![]() |
#1
|
|||
|
|||
![]() I have this code in an Excel VBA project. Code:
Set objWord = CreateObject("Word.Application") With objWord .DisplayAlerts = False .Visible = True Set oDoc = .Documents.Open(Filename:=fName, ConfirmConversions:=False, _ ReadOnly:=True, AddToRecentFiles:=False, Visible:=True) With oDoc With .MailMerge .MainDocumentType = wdFormLetters .Destination = wdSendtToNewDocument .SuppressBlankLines = True .OpenDataSource Name:=StrSrc, AddToRecentFiles:=False, LinkToSource:=False, ConfirmConversions:=False, _ ReadOnly:=True, format:=wdOpenFormatAuto, Connection:="Provider=Microsoft.ACE.OLEDB.12.0;" & _ "User ID=Admin;Data Source=" & StrSrc & ";Mode=Read;Extended Properties=""HDR=YES;IMEX=1;"";", _ SQLStatement:=StrSQL, SQLStatement1:="", SubType:=wdMergeSubTypeAccess .Execute Pause:=False End With .Close False End With "The OpenDataSource method or property is not available because this command is not available for reading." A few interesting observations (to me anyway) that may help diagnose the problem ... This code was written last year on my work computer and worked flawlessly. I opted to clean up some of my mail merge documents (formatting etc) from home last night and in my testing there did not get that error, and things worked as expected. This morning at work, I get this error. I have similar different mail merge documents that rely on this code. They all exhibit this behaviour.
This is a major setback for my application and my mail merge documents (for a novice) are complex. I am really hesitant to monkey around with stuff I have no idea about fearing damaging the work that so many have helped me with. I hope someone will be kind enough to walk me through a diagnosis (using information they need to help track it down) to resolve this. |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Excel to word Mail Merge problem | mark_kofi | Mail Merge | 4 | 07-17-2018 03:49 PM |
![]() |
drgt | Mail Merge | 2 | 02-14-2017 04:31 AM |
![]() |
Hook | Mail Merge | 2 | 01-11-2012 09:36 AM |
Mail Merge Problem | JohnRG | Mail Merge | 0 | 11-02-2009 02:50 AM |
problem in Mail merge | rjagathe | Mail Merge | 0 | 08-12-2009 08:25 AM |