In my Worksheet, I populate first Sheet with some data from Oracle. In column 14 (N) I have last names of Agents which I keep in an array [tt]strNames[/tt]. Then I filter Sheet1 for an Agent’s name, copy the data, add a Sheet for that Agent’s name, and paste the data to the new Sheet.
Sheet1 has only 163 rows (and 16 columns) of data, so it is not that big. But at the RED line of code I get en Excel error: "Excel cannot complete this task with available resources. Choose less data or close other application" . At VB editor I gat: "Run-time error 1004 – Paste method of Worksheet class failed"
I don’t have anything else running on the computer, so all the computer’s resources are available.
(All of this is actually done from VB 6, that’s why all the . (dots) in the code for Excel Application object.)
What am I doing workng? It used to work...
Have fun.
---- Andy
A bus station is where a bus stops. A train station is where a train stops. On my desk, I have a work station.
Code:
For intA = LBound(strNames) To UBound(strNames)
If strNames(intA) <> "" Then
.Sheets(1).Select
.ActiveSheet.Range("$A$1:$O$" & recTAC.RecordCount + 1).AutoFilter Field:=14, Criteria1:=strNames(intA)
.Selection.Copy
.Sheets(.Sheets.Count).Select
.Sheets.Add
.Sheets(.Sheets.Count - 1).Name = strNames(intA)
[red]
.ActiveSheet.Paste[/red]
...
End IF
Next intA
Sheet1 has only 163 rows (and 16 columns) of data, so it is not that big. But at the RED line of code I get en Excel error: "Excel cannot complete this task with available resources. Choose less data or close other application" . At VB editor I gat: "Run-time error 1004 – Paste method of Worksheet class failed"
I don’t have anything else running on the computer, so all the computer’s resources are available.
(All of this is actually done from VB 6, that’s why all the . (dots) in the code for Excel Application object.)
What am I doing workng? It used to work...
Have fun.
---- Andy
A bus station is where a bus stops. A train station is where a train stops. On my desk, I have a work station.