方法或数据成员找不到Range.Address方法的错误
我对VBA很陌生,但是我正在尝试编写一个程序,在MS Word中select和右键单击一个单词时,它将提供翻译build议。 我在Found.Address下面的代码中收到消息“Compile-Error:Method or data member not found”
Dim Current As String Dim oSheet As Range Dim Found As Range Dim firstAddress As String Dim oChanges As Worksheet Dim sFname As String Dim oExcel As Excel.Application Set oExcel = New Excel.Application oExcel.Visible = False sFname = "C:\Users\user\Desktop\translations.xlsx" Set oChanges = oExcel.Workbooks.Open(FileName:=sFname) Set oSheet = ActiveSheet.UsedRange 'Prepping Excel File Set oSheet = ActiveSheet.UsedRange Current = Selection.Text With oSheet Set Found = .Find(Current) If Not Found Is Nothing Then firstAddress = Found.Address Do .................................
我直接从VBA的Range.Find帮助页面复制这个格式。 我错过了什么?