Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Excel com integration - can this be achieved with vfp8
Message
From
05/10/2002 16:30:41
 
 
To
05/10/2002 08:30:24
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00708057
Message ID:
00708118
Views:
12
This message has been marked as the solution to the initial question of the thread.
2) oExcel.sheets(1).range("A2:A100") = myfoxarray

If your VFP data were in a cursor instead of an array you could use code like this to stuff the clipboard with the data and paste it into Excel:
*** Now fill in the data
WITH loWb.ActiveSheet
  *** Give it a name so we can reference it
  *** after we add a new sheet for the chart
  .Name = "ChartData"
  *** Get the number of field in eachs record
  lnFldCount = FCOUNT( 'csrResults' )
  *** Add one because copying the data to the clipboard
  *** adds a row for the field names
  lnRecCnt = RECCOUNT( 'csrResults' ) + 1
  SELECT csrResults
  GO TOP
  *** Copy to clipboard with fields delimited by tabs
  _VFP.DataToClip( 'csrResults', RECCOUNT( 'csrResults' ), 3 )
  *** Get the range of the data in the worksheet
  lcCell = 'A1:' + CHR( 64 + lnFldCount ) + TRANSFORM( lnRecCnt )
  *** And paste it in
  .Paste( .Range( lcCell ) ) 
  *** But now we have to make sure that cell A1 is blank
  *** Otherwise the chart is not created correctly
  .Range( "A1" ).Value = ""
ENDWITH
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform