Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Datarange pastespecial problem
Message
De
30/06/2010 09:49:14
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
30/06/2010 01:56:20
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP
Network:
Windows XP
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01471047
Message ID:
01471069
Vues:
38
>Hi,
>
>I keep getting an error - "unable to get the pastespecial property of the range class.." when I run my program. I am copying the contents of a table to the Windows clipboard, modifying it a little then, pasting it into a data range. Or, I should say I am trying to. My purpose ultimately is to copy values and not destroy the formulas that are already in place.
>
>My apologies for the extra comments and any redundancy that is displayed. I have been working this problem for the past 3 days... it's a bit frustrating and I stopped being neat yesterday. :-)
>
>Here's my code:
>
>
>#DEFINE xlPasteAll -4104
>#DEFINE xlPasteFormulas -4123
>#DEFINE xlPasteValues -4163
>#DEFINE xlNone -4142
>
>TargetFile = "alldetail.xls"
>
>* create Excel objects
>loExcel = CREATEOBJECT("Excel.application")
>loExcel.DisplayAlerts = .f.
>loExcel.ScreenUpdating=.f.
>
>loExcelWorkBook = loExcel.Application.Workbooks.Open(TargetFile)
>
>
>SELECT alldetail && (table created by query)
>* Export the contents of this file into the named range of the detail template "importdata"
>GO top
>IF NOT EOF()
>loExcelWorkSheet = loExcelWorkBook.Worksheets("Sales and Use Tax")
>loExcelRange = loExcelWorkSheet.range("importdata")
>
>_VFP.DataToClip(,,3) && current table onto the clipboard, delimited with tab
>mclip = _cliptext
>mclip = SUBSTR(mclip,458) && trim field header names
>mclip = STRTRAN(mclip,".NULL.")
>mclip = thisform.trim_clipboard_text(mclip)
>_cliptext = mclip
>
>*previous attempts here:
>* loExcelWorkSheet.range("importdata").pastespecial(-4163,-4142,.F.,.F.) && xlpastevalues
>* loExcelRange.pastespecial(-4163,-4142,.F.,.F.) && xlpastevalues
>
>* error occurs on this line of code:
>loExcelRange.PasteSpecial(xlPasteValues)
>
>endif
>
>
>
>Thanks in advance for helping!!!
>
>Paul

Paul,
I answered in more detail on foxite. Here I would only point to the error. It would be default xlPasteAll:
loExcelRange.PasteSpecial()
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform