Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Pivot Table Clear All Filters | Excel Discussion (Misc queries) | |||
How to save & reapply a set of excel filters after clear | Excel Discussion (Misc queries) | |||
VB to clear any filters when closing a spreadsheet | Excel Discussion (Misc queries) | |||
How to clear all filters in worksheet for all columns | Excel Discussion (Misc queries) | |||
Clear Auto Filter on Close (or open) | Excel Discussion (Misc queries) |