LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Prevent ShowAllData Method from failing

Hi,
I have an Excel 2007 worksheet that has autofilters and macros assigned to
option buttons in a Group Box that carry out some of the filtering. One
button is the ShowAllData button that removes the filter. If the ShowAllData
button is selected and then selected again (before any other button in the
group is selected) I get a Run Time Error that the ShowAllData method of
worksheet class failed. How do I prevent this error? I'm very new to VB.
The code below is what I'm having trouble with.
Thanks,
Jim

Sub UnhideBlanks()
'
' UnhideBlanks Macro
'
ActiveSheet.Unprotect Password:="sivle"
If ActiveSheet.AutoFilterMode = True Then
ActiveSheet.ShowAllData
ElseIf ActiveSheet.AutoFilterMode = False Then
Else
ActiveSheet.Protect Password:="sivle", DrawingObjects:=True,
Contents:=True, Scenarios:=True _
, AllowSorting:=True, AllowFiltering:=True
End If

End Sub

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Select method failing CDM Excel Programming 1 December 31st 09 06:52 AM
copy method of object failing vj2india Excel Programming 0 April 20th 06 02:21 AM
Select Method Failing cmk18[_8_] Excel Programming 2 July 11th 05 11:53 PM
Publish method failing, can't understand why Mark Excel Programming 0 June 22nd 05 07:52 PM
add method of validation failing mark kubicki Excel Programming 2 April 19th 05 08:08 PM


All times are GMT +1. The time now is 05:29 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"