ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro Problem (https://www.excelbanter.com/excel-programming/357505-macro-problem.html)

[email protected]

Macro Problem
 
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


Dave Peterson

Macro Problem
 
Maybe the replies you got in .excel would work?

wrote:

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


--

Dave Peterson

[email protected]

Macro Problem
 
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


Dave Peterson

Macro Problem
 
Close all other running programs?????

wrote:

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


--

Dave Peterson


All times are GMT +1. The time now is 11:21 AM.

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