Re: VFP9 - Save as XLSX

Author: Fernando D. Bozzo

Posted: 2018-04-16 at 13:42:59

In Business Assurance, with 1000's of licences and CIOs looking for cutting

costs down, I can assure you that I know some people that do not have

Excel, and of course Excel is not installed on all +300 servers.

2018-04-16 20:33 GMT+02:00 Stephen Russell <srussell705@gmail.com>:

> In busienss consulting, I cannot remember ANYONE that didn't have excel

> installed. It is a no brainer expecting it in that this is a desktop

> environment and not a server based web farm.

>

> On Mon, Apr 16, 2018 at 11:50 AM, Fernando D. Bozzo <fdbozzo@gmail.com>

> wrote:

>

> > The adventage of Vilhelm's method is that he manipulates the XLSX file

> > without Excel (at least for reading, didn't test with writing)

> >

> > Not needing Excel is really a Plus, because you need an Excel license in

> > each machine that you need to use it, even if you only need an unattended

> > server for automated conversion tasks.

> >

> >

> >

> > 2018-04-16 18:46 GMT+02:00 Stephen Russell <srussell705@gmail.com>:

> >

> > > Or learn how to manipulate Excel as a com object and have Excel bring

> in

> > > the data for you into the modern sheet format.

> > >

> > > A for loop within a for loop to get rows and columns.

> > >

> > > On Mon, Apr 16, 2018 at 11:32 AM, Peter Cushing <

> > > pcushing@whisperingsmith.com> wrote:

> > >

> > > > On 16/04/2018 17:17, Desmond Lloyd wrote:

> > > >

> > > >> Good Morning,

> > > >>

> > > >> Need to be able to copy the contents of a cursor to an Excel file,

> > but

> > > it

> > > >> needs to be in the xlsx.

> > > >>

> > > >> Am a newbie to Excel Automation and have read that you can saveas,

> > and

> > > it

> > > >> will save in the latest format. Well mine doesn't.

> oworkbook.version

> > > >> shows 16. (we are running Office 365)

> > > >>

> > > >> Tried the SweetPotato method but it errors out. Not sure why.

> > > >>

> > > >> Would someone be kind enough to point me in the right direction,

> with

> > > >> some

> > > >> possible examples...

> > > >>

> > > >> You can copy the contents of the cursor out to .xls only using the

> > > > standard COPY TO ... TYPE XL5

> > > > Then you can use automation to create an .XLSX file. I'm using

> office

> > > > 365 but I am on version 15 so slightly older so you should be able to

> > > > create an .XLSX file with your version.

> > > >

> > > > #include include\excel.h

> > > > TRUE=.T.

> > > > FALSE=.F.

> > > > oExcel = CREATEOBJECT('excel.application')

> > > > oExcel.Workbooks.Open(myfile)

> > > > cOutfile2 = 'myfilev2.xlsx'

> > > > objexcel.ActiveWorkbook.SaveAs(cOutfile2, xlOpenXMLWorkbook)

> > > >

> > > >

> > > > In excel.h xlOpenXMLWorkbook is 51

> > > >

> > > > HTH,

> > > >

> > > > Peter

> > > >

> > > >

> > > > ,"This communication is intended for the person or organisation to

> whom

> > > it

> > > > is addressed. The contents are confidential and may be protected in

> > law.

> > > > Unauthorised use, copying or disclosure of any of it may be unlawful.

> > If

> > > > you have received this message in error, please notify us immediately

> > by

> > > > telephone or email.

> > > > www.whisperingsmith.com

> > > >

> > > > Whispering Smith Ltd Head Office:61 Great Ducie Street,

> > > > <https://maps.google.com/?q=h+Ltd+Head+Office:61+Great+

> > > Ducie+Street,&entry=gmail&source=g>

> > > > Manchester M3 1RR. Tel:0161 831 3700 Fax:0161 831 3715

> > > > London Office: 101 St. Martin's Lane,London, WC2N 4AZ Tel:0207 299

> > 7960

> > > >

> > > >

> > > >

> > > >

[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/CAGQ_JumkCNijvYzpWG01VYMB6FN0zAmFjdhcm0NALXzoyWeFfg@mail.gmail.com

** 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.

©2018 Fernando D. Bozzo