ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Auto Open - Clear all filters (https://www.excelbanter.com/excel-programming/348106-auto-open-clear-all-filters.html)

klm[_2_]

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


Dave Peterson

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

klm[_2_]

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


Dave Peterson

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


All times are GMT +1. The time now is 12:13 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com