Free Support Forum -

Excel pop up a warning message after a pivot table is created in an xlsm file when it is opened in Excel 2007


We have got an visual issue that Excel pop up a warning message after a pivot table is created in an xlsm file when it is opened in Excel 2007. The reason we raise it is because it is causing some stress on our client side. A template xlsm file for testing and an image which describes the sympton are attached.

To reproduce this issue, please run the following code against the template file:

Workbook targetworkbook;

targetworkbook =new Workbook(txtTargetFile.Text);Worksheet targetsheet = targetworkbook.Worksheets["Sheet1"];

//Getting the pivottables collection in the sheet

Aspose.Cells.Pivot.PivotTableCollection pivotTables = targetsheet.PivotTables;

//Adding a PivotTable to the worksheet

int index = pivotTables.Add("=Formulated!C3:F12", “a3”, “pivot1”);

//Accessing the instance of the newly added PivotTable

Aspose.Cells.Pivot.PivotTable pivotTable = pivotTables[index];

//Showing the grand totals

pivotTable.RowGrand =true;

pivotTable.ColumnGrand = true;//Setting the PivotTable report is automatically formatted

pivotTable.IsAutoFormat = true;

//Setting the PivotTable autoformat type.

pivotTable.AutoFormatType = Aspose.Cells.Pivot.PivotTableAutoFormatType.Report6;

//Draging the first field to the row area.

pivotTable.AddFieldToArea(Aspose.Cells.Pivot.PivotFieldType.Row, 0);

//Draging the third field to the row area.

pivotTable.AddFieldToArea(Aspose.Cells.Pivot.PivotFieldType.Row, 2);

//Draging the second field to the row area.

pivotTable.AddFieldToArea(Aspose.Cells.Pivot.PivotFieldType.Row,1);//Draging the fourth field to the column area.

pivotTable.AddFieldToArea(Aspose.Cells.Pivot.PivotFieldType.Column, 3);


You may need to adjust some of the code for testing. If you need anything else from us, please don’t hesitate to let us know.

Thanks and regards



Well, it is not an issue I think. Please do open your input file “copy+of+xslm+with+pivot+table.xlsm” into MS Excel 2010, you will get the same error message(s) as you do find with output (generated by Aspsoe.Cells component) file. It think there is some issue with your VBA macros in your template file.

Thank you.

Hi Amjad,

Thanks for your reply! I see there are some errors with the XSLM I sent you last time.

I tried to remove the macros with a new XSLM file, but I still get an pop up warning after creating the pivot table in OriginalXLSM.xlsm.

I have attached the new XLSM files for you to test. It is riginalXLSM.xlsm.OriginalXLSM.xlsm.

I also attached the result file which is Book1 (1).xlsm. If you open it in office 2007, you will see the warning message as in the attached image.




We fixed this issue. Please download: Aspose.Cells for .NET (Latest Version)

Hi Amjad,

The new dll resolved our issue. Thanks for the great effort you've made!




Thanks for your posting and using Aspose.Cells for Java.

We are glad to know your issue is resolved with the given fix.

If you find any other issue, please feel free to post your problems, we will soon look into them and help you asap.

Besides, we have lately done some major enhancements and added new features in our product, so you should also download and give a try to latest offline demos of Aspose.Cells which you can find from theses links.

These demos can work with Visual Studio 2005 , 2008 or 2010 or 2015 or 2019. Please read the readme.txt file before running the demos.