Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Auto Open - Clear all filters

I created a macro for an .xls stored on one of our network drives. The macro
is suposed to clear all filters upon opening the .xls However it only seems
to work on my machine. When my fellow associates open it, they get an error.

What am I doing wrong? (See macro below) I tried making it "Sub
Workbook_Auto_Open()" but then it didn't even work on my machine.

Sub Auto_Open()
'
' Auto_Open Macro
' Macro recorded 11/30/2005 by Kathy Miller
'

'
Application.CommandBars("Macros").Visible = True
Selection.AutoFilter
Selection.AutoFilter
End Sub

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Auto Open - Clear all filters

You sure they have a commandbar name macros?

Maybe their not on the same sheet as you and the selection is different.

How about just flying by and ignoring any errors.

Option Explicit
Sub Auto_Open()

Dim wks As Worksheet

Application.CommandBars("Macros").Visible = True

On Error Resume Next
For Each wks In ThisWorkbook.Worksheets
wks.ShowAllData
Next wks
On Error GoTo 0

End Sub

But this won't help if it's the commandbar that's the problem.

klm wrote:

I created a macro for an .xls stored on one of our network drives. The macro
is suposed to clear all filters upon opening the .xls However it only seems
to work on my machine. When my fellow associates open it, they get an error.

What am I doing wrong? (See macro below) I tried making it "Sub
Workbook_Auto_Open()" but then it didn't even work on my machine.

Sub Auto_Open()
'
' Auto_Open Macro
' Macro recorded 11/30/2005 by Kathy Miller
'

'
Application.CommandBars("Macros").Visible = True
Selection.AutoFilter
Selection.AutoFilter
End Sub


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Auto Open - Clear all filters

Dave,

Thanks, but, it didn't work. Other associates no longer get the Runtime
error 5, but the macros doesn't work either. Although it still works for me.

You ask if others have the command bar name macros and the answer is no, not
all of them do and I already considered this might be a problem and I went to
a couple machines and added the Macro Toolbar, but still we got errors upon
enabling the macros & opening of the .xls

I'm kind of new at this and I have run out of ideas!

Thanks,
klm


"Dave Peterson" wrote:

You sure they have a commandbar name macros?

Maybe their not on the same sheet as you and the selection is different.

How about just flying by and ignoring any errors.

Option Explicit
Sub Auto_Open()

Dim wks As Worksheet

Application.CommandBars("Macros").Visible = True

On Error Resume Next
For Each wks In ThisWorkbook.Worksheets
wks.ShowAllData
Next wks
On Error GoTo 0

End Sub

But this won't help if it's the commandbar that's the problem.

klm wrote:

I created a macro for an .xls stored on one of our network drives. The macro
is suposed to clear all filters upon opening the .xls However it only seems
to work on my machine. When my fellow associates open it, they get an error.

What am I doing wrong? (See macro below) I tried making it "Sub
Workbook_Auto_Open()" but then it didn't even work on my machine.

Sub Auto_Open()
'
' Auto_Open Macro
' Macro recorded 11/30/2005 by Kathy Miller
'

'
Application.CommandBars("Macros").Visible = True
Selection.AutoFilter
Selection.AutoFilter
End Sub


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Auto Open - Clear all filters

What are the errors that they get when they enable macros?

And you're sure that the other users are enabling macros--they have their
security settings (tools|macro|security|security level tab) set to something
that would allow macros to run?

klm wrote:

Dave,

Thanks, but, it didn't work. Other associates no longer get the Runtime
error 5, but the macros doesn't work either. Although it still works for me.

You ask if others have the command bar name macros and the answer is no, not
all of them do and I already considered this might be a problem and I went to
a couple machines and added the Macro Toolbar, but still we got errors upon
enabling the macros & opening of the .xls

I'm kind of new at this and I have run out of ideas!

Thanks,
klm

"Dave Peterson" wrote:

You sure they have a commandbar name macros?

Maybe their not on the same sheet as you and the selection is different.

How about just flying by and ignoring any errors.

Option Explicit
Sub Auto_Open()

Dim wks As Worksheet

Application.CommandBars("Macros").Visible = True

On Error Resume Next
For Each wks In ThisWorkbook.Worksheets
wks.ShowAllData
Next wks
On Error GoTo 0

End Sub

But this won't help if it's the commandbar that's the problem.

klm wrote:

I created a macro for an .xls stored on one of our network drives. The macro
is suposed to clear all filters upon opening the .xls However it only seems
to work on my machine. When my fellow associates open it, they get an error.

What am I doing wrong? (See macro below) I tried making it "Sub
Workbook_Auto_Open()" but then it didn't even work on my machine.

Sub Auto_Open()
'
' Auto_Open Macro
' Macro recorded 11/30/2005 by Kathy Miller
'

'
Application.CommandBars("Macros").Visible = True
Selection.AutoFilter
Selection.AutoFilter
End Sub


--

Dave Peterson


--

Dave Peterson
Reply
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
Pivot Table Clear All Filters MichaelR Excel Discussion (Misc queries) 8 July 24th 08 07:12 PM
How to save & reapply a set of excel filters after clear BerkeleyWit Excel Discussion (Misc queries) 1 June 17th 08 01:15 PM
VB to clear any filters when closing a spreadsheet Kevin Excel Discussion (Misc queries) 8 December 20th 07 06:05 PM
How to clear all filters in worksheet for all columns Helios Excel Discussion (Misc queries) 2 November 11th 07 11:19 PM
Clear Auto Filter on Close (or open) Karin Excel Discussion (Misc queries) 3 August 23rd 07 06:16 PM


All times are GMT +1. The time now is 04:43 PM.

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"