This code works in the local Workbook perfectly, but I can not figure out how (and I tried a couple of suggestions here on S.O.F.) to get it to work in the Personal.xlsb file. Any help is much appreciated.
Code:
'This macro works locally - need to get it to work at the Personal.xlsb level
Sub AdvLookupVals()
Dim colA_Range As Range
Dim rngLookupRange As Range
Dim rngFoundRange As Range
Dim wb As Workbook
ThisWorkbook.Worksheets("Sheet1").Activate
'when you do this, Lookup.xls becomes active and sets the range
Set wb = Workbooks.Open("C:\Lists\Resource_Lookup.xlsx", True, True) ' open the source workbook, read only
Set rngLookupRange = wb.Worksheets("Sheet1").Range("A1:A656")
'Makes target workbook active again
ThisWorkbook.Activate
'Set rngFoundRange = wb.Worksheets("Sheet1").Range("A1:A653")
'rngFoundRange.AdvancedFilter Action:=xlFilterInPlace, CriteriaRange:= '_ 'hoping this would make the macro work in Personal.xlsb
Range("A1:A653").AdvancedFilter Action:=xlFilterInPlace, CriteriaRange:= _
rngLookupRange, Unique:=False 'rngLookupRange gets the criteria from above. .filters by name.
'releases resources back to the system and close the other workbook
Set rngLookupRange = Nothing
wb.Close False ' close the source workbook without saving any changes
Set wb = Nothing ' frees memory
End Sub