Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem inserting date into Excel Sreadsheet
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00809556
Message ID:
00809566
Views:
22
Gregory

Courtesey of Cetin Basoz

Drop a web browser control into a ole container on a form, then put this code into the click event of a button
nodefault
With thisform.OleControl1
     .Navigate2('file://c:\global\mertest.xls')
     Do While .ReadyState # 4 && Wait for ready state
     EndDo
endwith

oXLS = thisform.OleControl1.object.document
oExcel = oXLS.Application 
 
* This code builds a table called mertest with data laid out as I want to see it on the spreadsheet.
do merrtestlonytd 

* Then copy and paste it into an excel worksheet template (with 4 graphs which show when the data is pasted)

select mertest 
with oExcel.ActiveWorkBook
  .WorkSheets('LON YTD').Activate
oExcel.ActiveWorkBook.ActiveSheet.Range("c8").PasteSpecial()
endwith
_Cliptext = "" && Empty clipboard
oExcel.Application.ActiveWorkbook.Save()
Works great


Colin
Specialist in Advertising, Marketing, especially Direct Marketing

I run courses in Business Management and Marketing
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform