Author: Kurt at VR-FX
Posted: 2017-02-16 at 12:56:28
Ha ha - I totally hear you! Gotta admit - I'm doing a bit of the same
thing today!!!
;-)
-K-
On 2/16/2017 1:34 PM, Richard Kaye wrote:
> It's not boredom; it's avoidance of real work. :-)
>
> --
>
> rk
> -----Original Message-----
> From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Kurt Wendt
> Sent: Thursday, February 16, 2017 1:26 PM
> To: profoxtech@leafe.com
> Subject: RE: Copy Excel worksheet to another workbook
>
> Hey rk - Great program name!!! Gosh - U must be bored - and its not even a Friday... :-)
>
> Regards,
> Kurt Wendt
> Senior Systems Analyst
>
>
> Tel. +1-212-747-9100
> www.GlobeTax.com
>
> -----Original Message-----
> From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Richard Kaye
> Sent: Thursday, February 16, 2017 1:04 PM
> To: profoxtech@leafe.com
> Subject: RE: Copy Excel worksheet to another workbook
>
> Clearly I'm avoiding doing anything productive right now.
>
> **************************************
> * Program: FunWithExcel1.prg
> * Date: 02/16/2017 12:46
> * VFP Version: Visual FoxPro 09.00.0000.7423 for Windows
> * Notes: open a workbook, copies the 2nd sheet before the current 2nd sheet, makes another copy after the 3rd sheet
> **************************************
> ACTIVATE SCREEN
> CLEAR
> LOCAL m.ox AS Excel.Application, m.ow AS Excel.Workbook, m.oss AS Excel.Worksheet
> m.ox=CREATEOBJECT([excel.application])
> m.ox.Workbooks.Open([c:\rfc\copytest.xlsx])
> m.ow=m.ox.ActiveWorkbook
> ?m.ow.Sheets.Count
> m.oss=ow.Sheets(2) && this example has 2 sheets. get a ref to the 2nd sheet
> m.oss.copy(ow.Sheets(2)) && copy it before the 2nd sheet
> ?m.ow.Sheets.Count
> m.oss.copy(,ow.Sheets(3)) && copy it after the 3rd sheet
> ?m.ow.Sheets.Count
> m.ox.Visible=.t.
>
>
>
[excessive quoting removed by server]
_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/d43d989b-fa74-b8cb-57a7-0bbb8e606466@optonline.net
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.