Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Excel - Unable to get Paste property of Worksheet class
Message
From
02/06/2001 10:11:40
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
01/06/2001 15:18:30
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00513987
Message ID:
00514177
Views:
138
>I should have also include that the error number was '800a01ad'
>
>>The following code works without any issue in a regular VFP Class:
>>
>> SELECT c_sum2
>> GO TOP
>> Application.DataToClip(,,3) && copy data to clipboard delimited with tabs
>> USE IN c_sum2
>> This.oExcel.Range("A1").Select()
>> This.oExcel.ActiveSheet.Paste()
>>
>>However the last line [.ActiveSheet.Paste()] creates the following
>>error when I run this thru a registered DLL:
>>
>> Error in line 161 OLE IDispatch exception code 0 from Microsoft Excel:
>> Unable to get the Paste property of the Worksheet class.. 429
>>
>>Any ideas on how this can be resolved? I tried both application.datatoclip()
>>and the _CLIPTEXT = FILETOSTR(file) techniques to no avail

Tom,
What's this.oExcel ? Excel.Application or WorkBook, WorkSheet ?
In first line it sounds to be a worksheet :
This.oExcel.Range("A1").Select()

These would work :
application.datatoclip('customer',reccount(),3)
oExcel=createobject('Excel.Application')
with oExcel
 .Workbooks.Add
 with .ActiveWorkBook.Activesheet
  .Paste()              && Pastes at default A1 range
*  .Paste(.Range('B7')) && Paste starting from B7
 endwith
 .Visible=.t.
endwith
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
Next
Reply
Map
View

Click here to load this message in the networking platform