Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Controlling Excel97 from VFP5
Message
From
07/07/1999 13:05:23
 
 
To
07/07/1999 12:25:20
Chris Laffoon
Florists' Interlink, Inc.
Paragould, Arkansas, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00238364
Message ID:
00238387
Views:
12
Try this out. I have done some extensive work with integration of VFP and office. Let me know if it works or not.

loExcel = CreateObject('Excel.Application')
loExcel.Workbooks.Add
loBook = loExcel.ActiveWorkBook
loSheet = loExcel.ActiveSheet
loExcel.Visible = .T.

* Populate My Sheet
B = 1
For A = 65 To 90
lcA1 = "A" + ALLTRIM(STR(B))
lc1A = CHR(A) + "1"
loExcel.Range(lc1A).Value = A
loExcel.Range(lcA1).Value = A
B = B + 1
NEXT


* Select My Range
loSheet.Range("A1:Z26").Select

* Copy My Range
loSheet.Range("A1:Z26").Copy

* Paste My Range
loExcel.Worksheets("Sheet3").Activate
loSheet3 = loExcel.ActiveSheet
loSheet3.Paste

Thanks
Darren
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform