G
Guest
I have an excel workbook with 2 sheets and a vba module. I use ADO to connect
to a sql server 2000 to collect some data. Download of data to excel is
controlled from a combobox and some buttons on sheet1. The user selects a
customer (in the combobox) and downloads from 400 to 5000 records from sql
server. The records are visible on sheet1, so the operator can browse the
data.
Om sheet2 there is a pivot table that shows data from sheet1. Unfortunately
the pivot table is not correctly updated when the operator deletes old data
and downloads some new on sheet1. This seem to happen if the pivot table was
established with 500 records on sheet1. In the next case there may be 5000
records, and only a fraction of these are shown in the pivot table.
"Refresh data" on the Excel Data menu do not fix the problem. It seems I
need to reset the data source for the pivot table, and this have to be done
without changing the structure (column-, row-, and page-fields) on the pivot
table. How can this be done in VBA-code?
Regards
Tore G.
to a sql server 2000 to collect some data. Download of data to excel is
controlled from a combobox and some buttons on sheet1. The user selects a
customer (in the combobox) and downloads from 400 to 5000 records from sql
server. The records are visible on sheet1, so the operator can browse the
data.
Om sheet2 there is a pivot table that shows data from sheet1. Unfortunately
the pivot table is not correctly updated when the operator deletes old data
and downloads some new on sheet1. This seem to happen if the pivot table was
established with 500 records on sheet1. In the next case there may be 5000
records, and only a fraction of these are shown in the pivot table.
"Refresh data" on the Excel Data menu do not fix the problem. It seems I
need to reset the data source for the pivot table, and this have to be done
without changing the structure (column-, row-, and page-fields) on the pivot
table. How can this be done in VBA-code?
Regards
Tore G.