我的网页上有以下代码。我在我的参考
中有程序集Microsoft.Office.Interop.Excel Sub Main()
' Create new Application.
Dim excel As Application = New Application
' Open Excel spreadsheet.
Dim w As Workbook = excel.Workbooks.Open("C:\file.xls")
' Loop over all sheets.
For i As Integer = 1 To w.Sheets.Count
' Get sheet.
Dim sheet As Worksheet = w.Sheets(i)
' Get range.
Dim r As Range = sheet.UsedRange
对于范围单词,它给出错误说" Syste.data.Range在此上下文中无法访问,因为它是朋友。