Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Pating In Excel
Message
From
18/05/2001 10:45:10
Todd Wolfe
Certified Marketing Services
Kinderhook, New York, United States
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Pating In Excel
Miscellaneous
Thread ID:
00508718
Message ID:
00508718
Views:
42
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,
Next
Reply
Map
View

Click here to load this message in the networking platform