Excel.Range.Find() looks outside the range for XlSearchDirection.x

D

David Thielen

I have a search where I call it using:

Range rtn = searchRange.Find("<wr:", startAfter, XlFindLookIn.xlValues,
XlLookAt.xlPart, XlSearchOrder.xlByRows, XlSearchDirection.xlPrevious, false,
false, Type.Missing);

Where searchRange and after are both a Range that is 1 cell - A1. The rtn
Range is the cell B4 which does have the requested text - but is outside the
requested range.

This appears to only be a problem for previous searches.

I have found the same problem when it is a range and I then call:
rtn = searchRange.FindNext(rtn);

which will wrap and start searching from the end again.

--
thanks - dave
david_at_windward_dot_net
http://www.windwardreports.com

Cubicle Wars - http://www.windwardreports.com/film.htm
 
J

Jialiang Ge [MSFT]

Hello Dave,

I am sorry that the Range.Find method finds the cells outside the specified
range when the range is composed of one cell in Excel Interop. Our internal
log shows a known issue of it, and no workaround or hotfix is provided yet.
My suggestion is that you should contact Microsoft Product Support
directly. Since it's a known issue, the support incident will be free of
charge.

To access Microsoft Product Support service, you may contact us at
1-(800)936-5800 or by choosing one of the options listed at
http://support.microsoft.com/common/international.aspx?rdpath=fh;en-us;cntac
tms.

Regards,
Jialiang Ge ([email protected], remove 'online.')
Microsoft Online Community Support

==================================================
For MSDN subscribers whose posts are left unanswered, please check this
document: http://blogs.msdn.com/msdnts/pages/postingAlias.aspx

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications. If you are using Outlook Express/Windows Mail, please make sure
you clear the check box "Tools/Options/Read: Get 300 headers at a time" to
see your reply promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top