Application.DisplayAlerts problem

  • Thread starter Thread starter Barb Reinhardt
  • Start date Start date
B

Barb Reinhardt

I'm using Office 2003. I have this code

Application.DisplayAlerts = False
oWS.Copy after:=oWS
Application.DisplayAlerts = True

When I step through the first line, and hover over
Application.DisplayAlerts, it still shows as TRUE. And when the copy
occurs, I get a run time error. The sheet you are copying has more than 255
characters, blah blah blah. I know it does. That's why I do other things
later to capture all of the data. Why am I having DisplayAlerts problems
here?

Thanks,
Barb Reinhardt
 
Hi,

I can't comment on the runtime error but i'm not surprised hovering over the
line shows displayalerts as TRUE it always does. Displayalerts being set to
false won't supress runtime errors.

Mike
 
To demonstrate the phenomen try this small routine and hover over the first
line.

Application.DisplayAlerts = False
If Application.DisplayAlerts = True Then
MsgBox "enabled"
Else
MsgBox "Disabled"
End If
Stop
Application.DisplayAlerts = True
Stop

Mike
 
Mike,

I just ran the same piece of code again and no run time errors. All I did
was log off and log back on a while back. Can you explain that?

Thanks,
Barb
 

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

Back
Top