>I have two sheets open one that I want to copy from and paste to another worksheet.
>
>I am able to copy the data to my clipboard and then when I try to past to my other sheet I want to start on Cell A4 but it keeps trying to past on cell A1 overwriting my data that I already have. I set my range on the sheet I would like to paste on to A4 but it don't work. Any ideas?
>
>copy to c:\temp\final_report.xls type xl5
>
> cFILE2='c:\temp\final_report.xls'
> oBook2=OEXCEL.WORKBOOKS.OPEN(cFILE2)
> oSheet2=oBook2.ActiveSheet
> myrga = 'A1:AZ' + alltr(str(reccount()))
> myrg = 'A2:AZ' + alltr(str(reccount()))
> myrg2 = 'A4:AM' + alltr(str(reccount() + 5))
>
> ORange2=osheet2.Range(myrg)
> oSourceRange=osheet2.Range(myrg)
> oSourceRange.Copy()
>
>
>
> ORange=oSheet.Range("A4")
>
> osheet.Paste()
> oBook2.Close()
> oSheet.Range(myrga).Columns.AutoFit()
>
>
>
>
>
>Thanks,
Todd,
I assume there is oSheet somewhere and thus oRange is valid there :
oRange.PasteSpecial()
BTW if you do paste before you close book2 you could set _cliptext='' to easily suppress clipboard dialog.
Cetin