#1
|
|||
|
|||
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? |
#2
|
||||
|
||||
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 |
#3
|
|||
|
|||
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!
|
#4
|
||||
|
||||
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 |
#5
|
|||
|
|||
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. |
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 opening file: "Found a problem with its contents" | PoppaDon | Word | 5 | 05-03-2016 02:53 PM |
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 |