Results 1 to 2 of 2
  1. #1
    jeskit is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Nov 2011
    Posts
    3

    Run time error 4605

    Hi,



    I have a access database which I am running in access 2013. I am having the problem where one of the forms has code which opens the Word read only mail merge file, produces the error message "Run-time error '4605': The OpenDataSource method or property is not available because this command is not available for reading". I have only started having this error message since moving to Access 2013, I have tried making the file non-read only and this stops message appearing. However this is not a helpful solution as I need the file to be read only so it does not get accidental written over. Does any one know of a way to stop this message appearing without having to make the file non-read only. Bleow is the code which opens the mail merge file:
    Code:
        Dim strFilePath As String
        Dim objWord As Word.Document
        DoCmd.RunMacro "AppRefnew"
        strFilePath = "C:\Letter1.docx"
        Set objWord = GetObject(strFilePath, "Word.Document")
        objWord.Application.Visible = True
        
        objWord.MailMerge.OpenDataSource _
        Name:="C:\database1", _
        LinkToSource:=True, _
        Connection:="TABLE datatable", _
        SQLStatement:="SELECT * FROM [datatable] WHERE [AppRefID]=[Ref2]"
        
        Set objWord = Nothing

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    if you don't want the file to be edited how come you're not putting it in a server location that's read only for your users?

    have you tried this type of method:

    http://www.vbaexpress.com/forum/show...-for-read-only

Please reply to this thread with any new information or opinions.

Similar Threads

  1. VBA Code Returning Error Run Time Error 3061
    By tgwacker in forum Access
    Replies: 2
    Last Post: 11-24-2013, 11:00 AM
  2. Replies: 3
    Last Post: 03-05-2013, 11:17 AM
  3. Replies: 0
    Last Post: 07-16-2012, 05:42 AM
  4. Replies: 6
    Last Post: 05-30-2012, 12:32 PM
  5. Replies: 5
    Last Post: 03-27-2012, 01:40 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums