VB打开与关闭excel提示错误

打开excel代码:
Set xlApp = CreateObject("Excel.Application") '创建EXCEL对象
xlApp.DisplayAlerts = False
Set xlBook = xlApp.Workbooks.Open(FileName:=App.Path + "\ysmy.xls", ReadOnly:=True, UpdateLinks:=0) '打开已经存在的EXCEL工件簿文件
xlApp.Visible = False '设置excel不可见
xlBook.RunAutoMacros (xlAutoClose)
Set xlSheet = xlBook.Worksheets("sheet1") '设置活动工作表

关闭excel代码:
Set xlSheet = Nothing '释放sheet对象
xlBook.Close SaveChanges:=False '关闭文件
Set xlBook = Nothing
xlApp.Quit '关闭Excel
Set xlApp = Nothing
在关闭时出现以下错误,请问是什么原因,该如何解决

有时我也经常遇到这种莫明其妙的问题,但我知道决不是excel没装好。你一步一步查,应该可以查出来。
温馨提示:答案为网友推荐,仅供参考
第1个回答  2014-04-13
office,办公软件的问题,重新下载一个试试。
相似回答