Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Pating In Excel
Message
From
18/05/2001 11:59:20
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
18/05/2001 10:45:10
Todd Wolfe
Certified Marketing Services
Kinderhook, New York, United States
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Miscellaneous
Thread ID:
00508718
Message ID:
00508781
Views:
16
>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
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Reply
Map
View

Click here to load this message in the networking platform