Runtime error in Microsoft Office Interop Excel

Ronald Chandler 41 Reputation points
2022-12-26T16:04:27.3+00:00

I am trying to speed up processing of an Excel worksheet through the use of the Excel.find feature. I am using Excel 2013, running windows 10 and Visual Studio Express 2013. My Visual basic code snippet is as follows:

Imports Excel = Microsoft.Office.Interop.Excel
Imports word = Microsoft.Office.Interop.Word
Imports Microsoft.Office
Imports System.Runtime.InteropServices

oXLSheet = oXLBook.Worksheets(year_value.ToString)
oXLSheet.Select()
Dim search_str As String
search_str = oXLSheet.find("balance propagation", LookIn:=xlValues)

The last statement produces the following runtime error"

"Public member 'find' on type 'Worksheet' not found"

What is causing this/

Microsoft 365 and Office Development Other
0 comments No comments
{count} votes

Accepted answer
  1. Viorel 122.6K Reputation points
    2022-12-26T19:43:12.3+00:00

    Try something like this:

    . . .  
    Dim r As Range  
    r = oXLSheet.UsedRange.Find("balance propagation", LookIn:=xlValues)  
    . . .  
    
    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.