J
John Thow
Hi Folks,
This has got me tearing my hair out. [What's left of it....;-) ]
I have an Excel macro that copies data from one workbook to another 'history'
one. The relevant bit of the code is:-
' Open Standard Weekly Book & Copy Weekly Sheet
Workbooks("whcasht.xls").Worksheets("Weekly Sheet").Activate
ActiveSheet.Cells.Select
Application.CutCopyMode = False
Selection.Copy
' Open Backup Workbook & Paste Weekly Sheet
Workbooks(FileDateX).Worksheets("Sheet1").Activate
ActiveSheet.Paste
This works every time.
Sometimes, it is necessary to bring back the 'history' workbook and add to the
data. I thought I'd use the same code (with the workbook names changed!) to
get the data back. This results in a 1004 runtime error. 'The information
cannot be pasted because the Copy area and the Paste area are not the same
size & shape.'
So I tried this:-
' Open Backup Weekly Sheet & Copy Weekly Sheet
Workbooks(WeeklySheetName).Worksheets("Sheet1").Activate
ActiveSheet.Cells.Range("A1:K81").Select
Application.CutCopyMode = False
Selection.Copy
' Open WhCasht Spreadsheet & Paste Backup Weekly Sheet
Workbooks("Whcasht.xls").Worksheets("Weekly Sheet").Activate
ActiveSheet.Cells.Range("A1:K81").Select
Selection.Paste
This results in a 438 runtime error on the the Selection .Paste statement.
'Object doesn't support this property or method.'
Any ideas?
TIA
--
John Thow
an optimist is a guy/ that has never had/ much experience -
certain maxims of archie; Don Marquis.
To e-mail me, replace the DOTs in the Reply-To: address with dots!
This has got me tearing my hair out. [What's left of it....;-) ]
I have an Excel macro that copies data from one workbook to another 'history'
one. The relevant bit of the code is:-
' Open Standard Weekly Book & Copy Weekly Sheet
Workbooks("whcasht.xls").Worksheets("Weekly Sheet").Activate
ActiveSheet.Cells.Select
Application.CutCopyMode = False
Selection.Copy
' Open Backup Workbook & Paste Weekly Sheet
Workbooks(FileDateX).Worksheets("Sheet1").Activate
ActiveSheet.Paste
This works every time.
Sometimes, it is necessary to bring back the 'history' workbook and add to the
data. I thought I'd use the same code (with the workbook names changed!) to
get the data back. This results in a 1004 runtime error. 'The information
cannot be pasted because the Copy area and the Paste area are not the same
size & shape.'
So I tried this:-
' Open Backup Weekly Sheet & Copy Weekly Sheet
Workbooks(WeeklySheetName).Worksheets("Sheet1").Activate
ActiveSheet.Cells.Range("A1:K81").Select
Application.CutCopyMode = False
Selection.Copy
' Open WhCasht Spreadsheet & Paste Backup Weekly Sheet
Workbooks("Whcasht.xls").Worksheets("Weekly Sheet").Activate
ActiveSheet.Cells.Range("A1:K81").Select
Selection.Paste
This results in a 438 runtime error on the the Selection .Paste statement.
'Object doesn't support this property or method.'
Any ideas?
TIA
--
John Thow
an optimist is a guy/ that has never had/ much experience -
certain maxims of archie; Don Marquis.
To e-mail me, replace the DOTs in the Reply-To: address with dots!