Excel.Application.get_Item not working

2019-07-30 14:57发布

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

Function using get_Item

Yet this method gives me an error

List of errors

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

(I'm using Excel 2013)

标签: vb.net excel
1条回答
时光不老,我们不散
2楼-- · 2019-07-30 15:34

As Hans Passant stated, instead of using

Excel.Application.get_Item

You should use

app.WorkBooks(name)

查看更多
登录 后发表回答