Error Number 5174
be down. Please try the request again. Your cache administrator is webmaster. Generated Fri, 14 Oct 2016 06:55:18 GMT by s_wx1094 (squid/3.5.20)
VBA Code & Other Help Word Help [SOLVED] Run-time error '5174' - File not found. If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. Results 1 to 3 of 3 Thread: Run-time error '5174' - File not found. Thread Tools Show Printable Version Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode 09-19-2014,11:29 PM #1 Jfp87 View Profile View http://answers.microsoft.com/en-us/msoffice/forum/msoffice_word-mso_other/run-time-error-5174-this-file-could-not-be-found/45405c29-40bd-43b5-b116-09a3e716ac5b Forum Posts View Blog Entries View Articles VBAX Regular Joined Jul 2014 Posts 46 Location Run-time error '5174' - File not found. Another one guys, I have tried to solve it but I'm not getting anywhere anymore. Here is some of the code I was helped out with in a previous post (Word 2010): varFile = Dir("F:\Joe\Test Folder\Test Destination\*.docx") Do While varFile <> "" Set oDoc = Documents.Open(varFile) http://www.vbaexpress.com/forum/showthread.php?50774-Run-time-error-5174-File-not-found With oDoc .Bookmarks("Discip").Range.Text = strDiscip .Bookmarks("ProjectNumber").Range.Text = lngProjNum .Bookmarks("Rev").Range.Text = "A1" .ContentControls(1).Range.Text = Me.cboClient.Value .ContentControls(2).Range.Text = cboAsset.Value .ContentControls(3).Range.Text = txtWpkDocNo.Value .ContentControls(4).Range.Text = Me.cboDiscip.Value .ContentControls(5).Range.Text = txtWpkTitle.Value End With Debug.Print oDoc.FullName oDoc.Close wdSaveChanges Set oDoc = Nothing varFile = Dir Loop When I run the above code for example, I get this exact error message '5174' - File Not Found ("C:\users\U1830\Documents\PL.docx"). As you can see, the path in the error message is different to the path in my code. Not only that, but the path in the error message - as far as I can tell - doesn't exist. My understanding of paths is that if you follow it from one folder to the next, you end up at the final file\folder in the path name. I can't do that with the above path name - there is no "Documents" folder within "U1830" - the final file is correct though. I researched the error and found there can be problems when both the filename extension is not included as part of the FileName argument, and when the filename extension is something other than ".doc" - which it is. Line 3 was also highlighted by the debugger. Quite frustrating. Reply With Quote 09-20-2014,12:08
for Help Receive Real-Time Help Create a Freelance Project Hire for a Full Time Job Ways to Get Help Ask a Question Ask for Help Receive Real-Time Help Create a Freelance Project Hire for a Full Time https://www.experts-exchange.com/questions/23048272/debugging-error-message-5174.html Job Ways to Get Help Expand Search Submit Close Search Login Join Today http://www.vbforums.com/showthread.php?359-Error-5174-File-could-not-be-found Products BackProducts Gigs Live Careers Vendor Services Groups Website Testing Store Headlines Experts Exchange > Questions > debugging error message 5174 Want to Advertise Here? Solved debugging error message 5174 Posted on 2007-12-28 MS Word MS Excel 1 Verified Solution 7 Comments 845 Views Last Modified: 2010-04-21 hi ive got some code that MrBullWinkle runtime error and GrahamSkan helped me with. Ive put it below. It opens up a word doc from an excel workbook in Mailings on step 5. It does that successfully but when i return to excel there is a Run-Time error 5174. This file could not be found: C:\...\peter's eagle\MailMerge7.txt). id like to resolve the debugging (naming issue) ive done what i can to understand the reason for the runtime error 5174 bug and i think that the route isnt named correctly (but i dont know) ive messed about trying this line of code: DocPath = "C:\Documents and Settings\peter\My Documents\Mailings\Yr 7 English Report.doc" but it doesnt seem to help or hinder. the code in yellow to debug is: .OpenDataSource Name:=ThisWorkbook.Path + "\C:\peter's eagle\MailMerge7.txt", _ ConfirmConversions:=False, ReadOnly:=False, LinkToSource:=True, _ AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate:="", _ WritePasswordDocument:="", WritePasswordTemplate:="", Revert:=False, _ Format:=wdOpenFormatAuto, Connection:="", SQLStatement:="", SQLStatement1:="" and because of the error message im thinking the first line of the above code needs addressing (but i dont know) help on this would be appreciated. pete Private Sub CommandButton4_Click() PlayFile "c:\windows\media\Chimes.wav" Dim WordObj As Object Dim myPath As String 'Start Microsoft Word. myPath = ThisWorkbook.Path myPath = myPath + "\" + "Yr 7 English Report.doc" DocPath = "C:\Documents and Settings\peter\My Documents\Mailings\Yr 7 English Report.doc" 'Start Microsoft Word. Set WordObj = GetObject(myPath) If Err.Number <> 0 Then ' Word not running Set WordObj = CreateObject("Word.Application") End If WordObj.Application.Visible = True WordObj.Application.Documents("Yr 7 English R
be found If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. Results 1 to 4 of 4 Thread: Error 5174 - File could not be found Tweet Thread Tools Show Printable Version Subscribe to this Thread… Display Linear Mode Switch to Hybrid Mode Switch to Threaded Mode Nov 24th, 1999,12:44 AM #1 OlgaV View Profile View Forum Posts Thread Starter Junior Member Join Date Jan 1999 Location Scarsdale, NY Posts 26 Hello, I'm trying to open a document, and I think I was successful in doing so about 30 min ago, but now I get an error (Run-time error 5174: "This file could not be found") But!!! The file DOES exist!!! Please, help me if you can! Thank you! Here's my code: Set wrd = CreateObject("Word.Application") fileout = "C:\Test.rtf" wrd.Documents.Open fileout Reply With Quote Nov 24th, 1999,02:30 AM #2 netSurfer View Profile View Forum Posts Hyperactive Member Join Date Jun 1999 Location Calgary Alberta Posts 359 Well, I've only done this is Access using VBA but I do the same except: wrd.Application.Documents.Open fileout I have Application between the wrd object and Documents. I'm not sure whether this is particular for VBA or not though. Give it a shot. Hope it helps. Reply With Quote Nov 25th, 1999,07:58 PM #3 OlgaV View Profile View Forum Posts Thread Starter Junior Member Join Date Jan 1999 Location Scarsdale, NY Posts 26 Nope, that didn't work. It looks like the very first time I open a document, it's fine. After that - it gives me the error. Reply With Quote Nov 27th, 1999,05:20 PM #4 Quadrex View Profile View Forum Posts Visit Homepage Junior Member Join Date Nov 1999 Posts 26 Maybe you need to close the file when the Program quits, because it sounds like its staying in memory as being open. Just a thought. ------------------ Quadrex webmaster@quadrex.f9.co.uk Quadrex Programming Reply With Quote Quick Navigation Visual Basic 6 and Earlier Top Site Areas Settings Private Messages Subscriptions Who's Online Search Forums Forums Home Forums Visual Basic Visual Basic .NET VB.net CodeBank Visual Basic 6 and Earlier CodeBank - Visual Basic 6 and earlier Modern Windows Experience (Metro) Office Development Mobile Development ASP, VB Script Database Development Reporting API Games and Graphics Programming Game Demos COM and ActiveX Network Programming Visual Basic FAQs Slow Chat with the Microsoft Visual Basic team .NET ASP.NET Visual Basic .NET MVC .Net C# WPF, WCF, WF Silverlight .NET Architecture and Desig