successfully. Then my routine copies a range of cells and pastes them
into another range, this works fine every other time it runs. Every
other run of the code it fails at the line Selection.Copy with a
Runtime error 91:. I then run it again and it works fine. This is
really puzzling me a snippet of my code is below. Any ideas?
>>>>>>>>>>> >>>>>>>
ExcelApp.Workbo oks.Open ("C:\Test.xl s")
Set ExcelSheet = ExcelApp.Worksh eets("Sheet1")
ExcelSheet.Rang e("B13").CopyFr omRecordset rs
ExcelSheet.Rang e("O13:X13").Se lect
Selection.Copy ' Code fails here every second time it runs with Runtime
error 91:
ExcelSheet.Rang e(Cells(14, 15), Cells(rec + 12, 24)).Select
ActiveSheet.Pas te
ExcelApp.Active Workbook.Save
ExcelApp.Quit