打开 Excel 文件时出现错误 800a03ec [英] Getting error 800a03ec while opening an Excel file

查看:159
本文介绍了打开 Excel 文件时出现错误 800a03ec的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我编写了以下代码来将 XLSX 文件转换为 CSV 格式:

I have written following code to convert XLSX file to CSV format:

If WScript.Arguments.Count < 2 Then
    WScript.Echo "Error! Please specify the source path and the destination. Usage: XlsToCsv SourcePath.xls Destination.csv"
    Wscript.Quit
End If

Dim oExcel
Set oExcel = CreateObject("Excel.Application")
Dim oBook
Set oBook = oExcel.Workbooks.Open(Wscript.Arguments.Item(0))
oBook.SaveAs WScript.Arguments.Item(1), 6
oBook.Close False
oExcel.Quit

当我为 XLSX 文件提供服务器路径时,它工作正常.但是,当我提供本地机器路径时,它给了我以下错误:

It was working fine when I was giving server path for XLSX file. But, when I am giving local machine path, it is giving me following error:

找不到文件.检查文件名的拼写,并验证文件位置是否正确.如果您尝试从最近使用的文件列表中打开文件,请确保该文件未被重命名、移动或删除
代码:800A03EC
资料来源:Microsoft Office Excel

File could not be found. Check the spelling of the file name, and verify that file location is correct. If you are trying to open the file from list of most recently used files, make sure that file has not been renamed, moved or deleted
code: 800A03EC
Source: Microsoft Office Excel

推荐答案

如果遇到类似问题的任何人发现此问题,错误代码似乎是一个常规 Excel 错误,这意味着它无法打开文件.

In case anyone with a similar problem finds this, the error code seems to be a general Excel error which means that it could not open the file.

就我而言,我尝试手动打开同一个文件,发现 Excel 想要修复损坏的文件.我被允许使用不正确的验证保存它,但它不会以编程方式打开.手动打开它意味着它可以向我显示一个对话框,询问我是否要修复它.

In my case I tried opening the same file manually and found that Excel wanted to repair a corrupted file. I had been allowed to save it with incorrect validations, but it wouldn't open programmatically. Opening it by hand meant that it could show me a dialog asking whether I wanted to fix it or not.

这篇关于打开 Excel 文件时出现错误 800a03ec的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆