Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-28-2021, 12:44 PM
tanko tanko is offline Error: "File not found:" Windows 10 Error: "File not found:" Office 2016
Novice
Error: "File not found:"
 
Join Date: Jan 2021
Posts: 17
tanko is on a distinguished road
Default Error: "File not found:"

My code just started throwing this error today. It simply went from working to not working, without a restart and I believe without even having closed Word. Now every macro I try to run gets a prompt reading "File not found:" Weirdly, there's a colon, but no designation of what file is not found.



It looks like I [sometimes] don't get the error when I run the code from within the VB editor, but the error shows when I try to click one of my buttons, which suggests maybe the problem is within my CustomUI? But I can't understand why it would come out of nowhere.

Weirder still: I can get my buttons to work if I have closed Word and opened up my global template, and then open my document. But if I open the document first, the code won't run even from within the VB editor.

Any ideas?
Reply With Quote
  #2  
Old 10-28-2021, 02:40 PM
Guessed's Avatar
Guessed Guessed is offline Error: "File not found:" Windows 10 Error: "File not found:" Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,932
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

Generally there is a clue available when you examine the code. Since you haven't posted the code that fails it is up to you to fix.

Is the file created on the fly before the code tries to open it?
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #3  
Old 10-28-2021, 04:43 PM
tanko tanko is offline Error: "File not found:" Windows 10 Error: "File not found:" Office 2016
Novice
Error: "File not found:"
 
Join Date: Jan 2021
Posts: 17
tanko is on a distinguished road
Default

That's the thing. It's literally all of my code. I have a few dozen macros and all of them trip up with this error, even simple ones that just do textual work rather than manipulating files, and even ones that don't refer to other macros. I can set a breakpoint at the beginning of a macro and this error still appears. It was working this morning, and now it's not!
Reply With Quote
  #4  
Old 10-29-2021, 12:04 AM
gmayor's Avatar
gmayor gmayor is offline Error: "File not found:" Windows 10 Error: "File not found:" Office 2019
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

Word VBA stores up errors and it is not sufficient to simply restart Word. May I suggest that you address the measures at https://www.gmayor.com/what_to_do_when_word_crashes.htm then reboot the PC and see if the problem remains. If it does, post an example of your code so we can see what the issue might relate to.
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #5  
Old 11-16-2021, 12:54 PM
tanko tanko is offline Error: "File not found:" Windows 10 Error: "File not found:" Office 2016
Novice
Error: "File not found:"
 
Join Date: Jan 2021
Posts: 17
tanko is on a distinguished road
Default

I went through the steps Graham recommended, unfortunately to no avail. I ended up finding a StackOverflow thread on this problem happening in Access, and deep in that chain there was a suggestion to simply change any character in your VBA code to force it to recompile or something.

I added a return to one of my subroutines, Ctrl-S, restarted Word, and voila.
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
"The macro cannot be found or is disabled" error wardw Word VBA 4 07-02-2021 10:32 AM
"Word found unreadable content..." + "Word experienced an error trying to open..." onas Word 1 09-02-2019 10:52 AM
Error: "File not found:" Error opening file: "Found a problem with its contents" PoppaDon Word 5 05-03-2016 02:53 PM
Error: "File not found:" Microsoft Word Error: "This file could not be found." dextermccall Word 1 05-25-2015 11:21 AM
Error: "Changes made were lost...reconnect with server", when switching "from" field randhurrle Outlook 2 02-25-2015 06:51 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 01:58 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft