From: ch on
Hi all,

I have a macro which creates a Pivot Table using the records I provide and
it works fine up to probably 40,000 records.

When the database becomes too big, the program stops at the line of code
which creates the Pivot Table with an error message.
1) Pressing F5 simply gives the same error message.
2) Running the same macro from start with a reduced records works well again.

How can I overcome this problem?

Thanks in advance.
From: dk on
On Mar 5, 7:57 am, ch <c...(a)discussions.microsoft.com> wrote:
> Hi all,
>
> I have a macro which creates a Pivot Table using the records I provide and
> it works fine up to probably 40,000 records.  
>
> When the database becomes too big, the program stops at the line of code
> which creates the Pivot Table with an error message.
> 1) Pressing F5 simply gives the same error message.
> 2) Running the same macro from start with a reduced records works well again.
>
> How can I overcome this problem?  
>
> Thanks in advance.

Are the variables declared have sufficient range?