PDA

View Full Version : entirerow.delete



philfer
05-26-2010, 07:30 AM
Hello,

I am automating moving some data from access to excel.

I can get access to put information/formulae into certain cells in excel with :-

objWS.Range("data").Offset(1, 0).CopyFromRecordset rst, RcdCount, FldCount

objWS.Range("date") = ExportDate


objWS.Cells(EndRow + 3, TotalColumn).FormulaR1C1 = "=SUM(R[-" & EndRow - 1 & "]C:R[-3]C)"



but if I try to do :-

objWS.Range(Cells(EndRow + 11, 1), Cells(95, 1)).EntireRow.Select
Selection.Delete Shift:=xlUp

I get the error :-

1004 Application defined or object defined error

if I then delete the data that has been copied in the copyfromrecordset and save the workbook back down and run the proc again the line which gives me the error works just fine

I cant fathom why this is happenening

Has it happened to anyone else before

(on a different proc I try to do entirerow.insert and objWS.Range(Cells(StartRow, 1), Cells(EndRow - 1, 1)).DataSeries and the same problem happens)


Thanks
Phil

philfer
05-26-2010, 07:34 AM
Sorry guys

I dont know why my posts are coming in this daft format