Excel.Application.get_Item不起作用 [英] Excel.Application.get_Item not working
本文介绍了Excel.Application.get_Item不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在寻找一种方法来检查是否已打开Excel文件,并且发现的解决方案或多或少都具有该功能
I was looking for a way to check if an Excel File was opened and the solutions I found were more or less this function
但是这种方法给我一个错误
Yet this method gives me an error
那是'get_Item'不是'Microsoft.Office.Interop.Excel.Workbooks'的成员."
That's "'get_Item' is not a member of 'Microsoft.Office.Interop.Excel.Workbooks'."
我想念什么?我已经在不同的解决方案中多次见过这种方法
What am I missing? I've seen this method a couple times in different solutions
(我正在使用Excel 2013)
(I'm using Excel 2013)
推荐答案
就像汉斯·帕森特(Hans Passant)所说的那样,而不是使用
As Hans Passant stated, instead of using
Excel.Application.get_Item
Excel.Application.get_Item
您应该使用
app.WorkBooks(name)
app.WorkBooks(name)
这篇关于Excel.Application.get_Item不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文