Hannes has attended:
No courses
Excel Macro
Hi,
I've recorded the following macro:
'''''''''''''''''''''''''''''''''''''''
Workbooks.Open Filename:= _
"C:\Data\Financial Planning Macro Building Project\A020 DEVELOPED MARKETS.xls"
Windows("Trans and Volumes.xls").Activate
Range("C7").Select
Sheets("Data Sheet").Select
Windows("A020 DEVELOPED MARKETS.xls").Activate
Application.Run "'A020 DEVELOPED MARKETS.xls'!MENU"
Application.Run "'A020 DEVELOPED MARKETS.xls'!ISSCTR"
Range("A4").Select
ActiveWorkbook.ShowPivotTableFieldList = True
ActiveSheet.PivotTables("PivotTable6").PivotFields("BRAND").CurrentPage = _
"MASTERCARD"
Range("BA23:BI24").Select
Selection.Copy
'''''''''''''''''''''''''''''''''''''''''''''''
My goal is once the macro is run to open antoher file and make changes on the pivot in that file and then to copy the result to the original file.
Everytime I run the macro it fails and show an error in the section which selects the pivot and changes the pivot fields.
I think this might have to do with the fact that the excel file is protected.
Any suggetions on how I can get this to run?