Results 1 to 4 of 4
  1. #1
    Star Lounger
    Join Date
    Sep 2004
    Location
    St. Louis, Missouri, USA
    Posts
    83
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Run-time error 5174 (Office 2003/Windows XP)

    Message -- Run-time error '5174'; This file cound not be found. Try one or more of the following... The file is there, I can do it manually every time and occasionally the macro runs without a hitch. What is the problem?? The macro syntax follows:
    Documents.Open FileName:="""Vertical Lines for Employee List.doc""", _
    ConfirmConversions:=False, ReadOnly:=False, AddToRecentFiles:=False, _
    PasswordDocument:="", PasswordTemplate:="", Revert:=False, _
    WritePasswordDocument:="", WritePasswordTemplate:="", Format:= _
    wdOpenFormatAuto, XMLTransform:=""
    Thanks for your help. Lana

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Run-time error 5174 (Office 2003/Windows XP)

    Perhaps the times it fails Word is looking in the wrong path? You are not setting the path in your code (or you didn't supply that line).

    Take a look at ChangeFileOpenDirectory and Options.DefaultFilePath(wdCurrentFolderPath) for some options of pointing Word in the right direction, or change the FileName parameter to include the full path.

    Hope this helps.

  3. #3
    Star Lounger
    Join Date
    Sep 2004
    Location
    St. Louis, Missouri, USA
    Posts
    83
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Run-time error 5174 (Office 2003/Windows XP)

    Hi,
    Thanks for the suggestion. Would you believe I think removing the superfluous quote marks around the file name (it had three sets) fixed the problem. I did that because I noticed the error message showed ("Vertical Lines for Employee List.doc"). After removing the two extra sets of quotes I can no longer get it to fail. Go figure! I didn't write that, I recorded it - so it was the program that put them in there to begin with. How odd!
    Lana

  4. #4
    Gold Lounger
    Join Date
    Dec 2000
    Location
    New Hampshire, USA
    Posts
    3,386
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Run-time error 5174 (Office 2003/Windows XP)

    Yes, that was the problem.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •