vba 每次启动 Excel 时都会弹出错误消息 - 如何摆脱它?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9037146/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Error message pops up every time I start Excel - how to get rid of it?
提问by vasek1
I am using Excel 2007 at work. A few months ago I wrote a VBA script which referenced some files on our network drive. Ever since that day, whenever I fire up Excel (any file, not just the file I was working with), I get this message:
我在工作中使用 Excel 2007。几个月前,我写了一个 VBA 脚本,它引用了我们网络驱动器上的一些文件。从那天起,每当我启动 Excel(任何文件,而不仅仅是我正在使用的文件)时,我都会收到以下消息:
\(network file path)(dir)\test.csv' could not be found. Check the spelling of the file name, and verify that the file location is correct.
If you are trying to open the file from your list of most recently used files, make sure that the file has not been renamed, moved, or deleted.
\(网络文件路径)(dir)\test.csv' 找不到。检查文件名的拼写,并验证文件位置是否正确。
如果您尝试从最近使用的文件列表中打开该文件,请确保该文件未被重命名、移动或删除。
The file it's referencing was a test file we used to debug, and it has been deleted. I noticed that if I add the file back to its location, the error goes away (which makes sense, since it can now find the file). But, it seems very odd to me that every time I start Excel it does a query for that file. Any ideas on how to stop this behavior?
它引用的文件是我们用来调试的测试文件,它已被删除。我注意到如果我将文件添加回它的位置,错误就会消失(这是有道理的,因为它现在可以找到文件)。但是,每次我启动 Excel 时,它都会查询该文件,这对我来说似乎很奇怪。关于如何阻止这种行为的任何想法?
回答by mischab1
You say the at startup open all files in
field is empty, but what about your start folder itself?
您说该at startup open all files in
字段为空,但是您的起始文件夹本身呢?
While Excel is closed, open Windows Explorer, type this in the address %appdata%\Microsoft\Excel\XLSTART
and press enter.
关闭 Excel 后,打开 Windows 资源管理器,在地址中键入此内容%appdata%\Microsoft\Excel\XLSTART
并按 Enter。
The easty fix would be that XLSTART has a shortcut to the missing file. If so, delete it.
最简单的解决方法是 XLSTART 有一个指向丢失文件的快捷方式。如果是这样,请将其删除。
If that didn't fix your problem try temporarily removing all files in XLSTART. (Move them to your desktop or some place easy.) Restart Excel, do you still get the error?
如果这不能解决您的问题,请尝试暂时删除 XLSTART 中的所有文件。(将它们移动到您的桌面或其他容易的地方。)重新启动 Excel,您仍然收到错误消息吗?
Assuming you don't get the error, open the files you removed from XLSTART one by one to see which one is causing the error.
假设您没有收到错误,请一一打开您从 XLSTART 中删除的文件,看看是哪个文件导致了错误。
回答by Z Y
I had a similar problem and found the answer here:
我遇到了类似的问题,并在这里找到了答案:
http://www.msfn.org/board/topic/155156-excel-2010-error-popup-while-lauching-or-opening-files/
http://www.msfn.org/board/topic/155156-excel-2010-error-popup-while-lauching-or-opening-files/
Go to "HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Excel\Options" and see if there's a string value for OPEN that has the problem file path in question and delete it.
转到“HKEY_CURRENT_USER\Software\Microsoft\Office\14.0\Excel\Options”并查看是否有 OPEN 的字符串值包含有问题的问题文件路径并将其删除。
回答by Jimmy
I had the same issue and Excel had installed the file in question as an Add-in
.
我遇到了同样的问题,Excel 已将相关文件安装为Add-in
.
Easy to fix
易于修复
- File > Options > Add-ins
- Select Manage Add-ins
- Delete the file in question
- 文件 > 选项 > 加载项
- 选择管理加载项
- 删除有问题的文件
It sorts it out.
它整理出来。
回答by Shakir
Simply put, the problem is likely to lie within the length of your filepath.
简而言之,问题很可能出在文件路径的长度内。
Follow these steps to solve:
按照以下步骤解决:
- Copy the file to desktop to backup from
- Rename the original file if it has a long name
- Open it to test whether it has worked.
- 将文件复制到桌面进行备份
- 如果文件名很长,请重命名原始文件
- 打开它以测试它是否有效。