Macro Problem

  • Thread starter Thread starter lj
  • Start date Start date
L

lj

I am running into a problem when I try and run a macro that copies a
sheet that has a pivot table in it and moves it to another folder and
then copys-past special-values the sheet. When I try and run macros
that do this I get an error message when the macro finishes processing
that says "Excel cannot complete this task with available resources.
Choose less data or close other applications". Do you have any
suggestions or workarounds I can use to avoid this problem? Below is
an example of the visual basic I am using in the macro. The problem
occurs
when I copy and paste the pivot table. I do not have the same problem
when
a pivot table is not involved.

Sheets(Array("Calculations", "Trading_Profit")).Select
Sheets("Trading_Profit").Activate
Sheets(Array("Calculations", "Trading_Profit")).Copy
Cells.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
 
Maybe the replies you got in .excel would work?

I am running into a problem when I try and run a macro that copies a
sheet that has a pivot table in it and moves it to another folder and
then copys-past special-values the sheet. When I try and run macros
that do this I get an error message when the macro finishes processing
that says "Excel cannot complete this task with available resources.
Choose less data or close other applications". Do you have any
suggestions or workarounds I can use to avoid this problem? Below is
an example of the visual basic I am using in the macro. The problem
occurs
when I copy and paste the pivot table. I do not have the same problem
when
a pivot table is not involved.

Sheets(Array("Calculations", "Trading_Profit")).Select
Sheets("Trading_Profit").Activate
Sheets(Array("Calculations", "Trading_Profit")).Copy
Cells.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
 
The problem I'm having occurs when I try and copy-paste special-values
a pivot table in a macro, do you have any suggestions to get around
this?


Sheets("Trading_Profit").Activate
Sheets("Trading_Profit")).Copy
Cells.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
 
Close all other running programs?????

The problem I'm having occurs when I try and copy-paste special-values
a pivot table in a macro, do you have any suggestions to get around
this?

Sheets("Trading_Profit").Activate
Sheets("Trading_Profit")).Copy
Cells.Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top