How to fix the run time error 1004 in Excel 2016 to refresh a pivot table that is connecting a local SAS file in my Laptop.

Hyunsik Kim 1 Reputation point
2021-02-04T01:48:40.427+00:00

A pivot table in my Excel file is connected to a local SAS file(*.sas7bdat) in my Laptop.
After my laptop was updated from Win97 to Win10, I could not refresh the pivot table becasue of the run time error 1004 in Excel 2016.
I already installed the "SAS Add-In for MS office" and SAS ODBC driver(9.3 & 9.4 version both) into my laptop and tried to refresh the pivot table as the macro below but the run time error 1004 in Excel 2016 is happened with the ".PivotCache.Refresh" macro.
Could you let me know how I can fix it.

Workbooks.Open Filename:="C:\temp\QI_Detail_Body.xlsm"
Application.EnableEvents = True

ActiveSheet.Unprotect
ActiveSheet.PivotTables("PivotTable1").PivotCache.Refresh
    Range("F1").Value = Update_date
Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,562 questions
0 comments No comments
{count} votes