Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Application.ScreenUpdating not working

Status
Not open for further replies.

jawbonium

Technical User
Nov 5, 2003
9
US
I have a pair of weird errors here. The first is an error that I get with .Borders. I pretty much gave up on trying to fix it as it really wasn't that important and it was only occuring periodically. Thus I wanted to have the .Borders line execute when it could and suppress the error message when it couldn't. I inserted the following before my .Borders line:

Application.DisplayAlerts = False

and

Application.DisplayAlerts = True

after. However, the error message IS NOT being suppressed! GAH! Any ideas on why?
 
AFAIK Application.DisplayAlerts hides xl messages and not code errors. Try using an error handler for your code

e.g.
Sub test()
On error goto errhandler

'your code

Exit sub

errhandler:
'do something here - masgbox etc?
End sub

or perhaps on error resume next?

Chris ;-)

Visit for great xl and xl/VBA help
 
Thank you for the insight. Sorry about the inaccurate Subject line.
 
Y'know, I bet we can figure out why you're getting the error in the first place (but I can't promise anything).


Rob
[flowerface]
 
Well, I think I may have figured it out. This was the line that was barfing:

Sheets("Summary").Range(Cells(firstEmptyRow, 1), Cells(firstEmptyRow, 11)).Borders(xlInsideHorizontal).Weight = xlThin

I'm GUESSING that the reason this doesn't work is that there isn't technically an INSIDE horizontal line on a single row.
 
Methinks you may be right. But then, what is the point of the code line in the first place?


Rob
[flowerface]
 
Well, I have this nasty habit of cheating when it comes to formatting. I record a macro of what I want done then cut an' paste what I wanted out of it. Sometimes I tailor the generated script down, and in this instance while I trimmed it down, I didn't read it too carefully.

happy.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top