ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   SaveCopyAs corrupts pivot tables (https://www.excelbanter.com/excel-programming/384058-savecopyas-corrupts-pivot-tables.html)

D.Farns

SaveCopyAs corrupts pivot tables
 
I've got an Excel 2003 workbook that contains a couple of pivot tables which
work fine. The workbook also has a custom menu item that runs the SaveAsCopy
method to serve as a backup of the open workbook with a predetermined naming
convention and location. This also works fine.

My problem is if I refresh a pivot table and run the SaveAsCopy method, in
either order, then close the workbook, I get "Unable to Read File" error the
next time I open the workbook. After clicking OK, the file does open, but a
"Repair.." window is displayed explaining that the PivotTable Report "was
discarded due to integrity problems".

Does anyone have any ideas on what could be happening and how to address?

thanks

--
D.Farns

D.Farns

Additional Indo: SaveCopyAs corrupts pivot tables
 
If I refresh the pivot table using the "Refresh Data" option on the Data or
PivotTable menu I can run the SaveAsCopy method and NOT get the Unable to
Read File error next time I open the file. However, the pivot tables in this
workbook are refreshed via a line of code in a sub procedure which does cause
the error when SaveAsCopy is also run. I suspect I need to change my PT
refresh code. Here's what I'm using today to refresh:

Worksheets("MySheet").PivotTables("MyPT").PivotCac he.Refresh

--
D.Farns


"D.Farns" wrote:

I've got an Excel 2003 workbook that contains a couple of pivot tables which
work fine. The workbook also has a custom menu item that runs the SaveAsCopy
method to serve as a backup of the open workbook with a predetermined naming
convention and location. This also works fine.

My problem is if I refresh a pivot table and run the SaveAsCopy method, in
either order, then close the workbook, I get "Unable to Read File" error the
next time I open the workbook. After clicking OK, the file does open, but a
"Repair.." window is displayed explaining that the PivotTable Report "was
discarded due to integrity problems".

Does anyone have any ideas on what could be happening and how to address?

thanks

--
D.Farns



All times are GMT +1. The time now is 10:50 AM.

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