Smart questions
Smart answers
Smart people
Join Tek-Tips Forums

Member Login

Remember Me
Forgot Password?
Join Us!

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

Join Tek-Tips
*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.
Jobs from Indeed

Link To This Forum!

Partner Button
Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

lameid (Programmer) (OP)
6 Apr 12 17:17
I am automating Excel and the Excel Applciation is not visible.

XLRange is an Excel Range object.  "|hash|"  does not always occur which produces a message that I would rather surpress...  "Microsoft Excel Cannot find any data to replace.  Check if you search formatting and criteria are defined correctly. If you are sure that matching data exists in this workbook, it may be on a protected sheet. Excel cannot replace data on a protected worksheet."


XLRange.Replace What:="|hash|", Replacement:="#", LookAt:=xlPart, _
            SearchOrder:=xlByRows, MatchCase:=False, SearchFormat:=False, _

What if anything can I do to surpress the message?

SkipVought (Programmer)
6 Apr 12 17:57


FIRST do a Find, like...


dim rFound as range

set rFound = XLRange.Find("|hash|")

if not rFound is nothing then
  'now do your replace
end if


glassesJust traded in my old subtlety...
for a NUANCE!tongue

Helpful Member!  PHV (MIS)
6 Apr 12 18:07
a message that I would rather surpress
Did you try to set the DisplayAlerts property to False ?

Hope This Helps, PH.
FAQ219-2884: How Do I Get Great Answers To my Tek-Tips Questions?
FAQ181-2886: How can I maximize my chances of getting an answer?

lameid (Programmer) (OP)
9 Apr 12 10:19
I am not that familar with the Excel Object models...  I suspected there was a way to turn off messages.  Thanks PHV!
lameid (Programmer) (OP)
9 Apr 12 17:10
Can I get you guys to take a peek over at another Excel automation issue I am having out of the same procedure?

thread705-1680024: Orphaned Excel.Exe Process....
lameid (Programmer) (OP)
9 Apr 12 17:46
I did figure out the second issue or the linked thread above.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Back To Forum

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close