Dear all,

I created a salary report program for user use. However, user wants the
output is excel format. So, I use "copy to ...type xls" command to export
data to excel file. My problem is : create many excel file after run
program. Because, I separate each employee have one excel file. But user
wants one excel file to store all employee(separate page in excel). I am no
idea how to do that. Anyone have go that before? Please advice.

Thanks
Edmond

Re: one excel file ? by Fred

Fred
Wed Dec 01 21:21:30 CST 2004

Put all the employee records you want to have in the sinle Excel file into a
single table or cursor. Create your Excel file from that.

--
Fred
Microsoft Visual FoxPro MVP


<Edmond> wrote in message news:%23ZxOStB2EHA.3324@tk2msftngp13.phx.gbl...
> Dear all,
>
> I created a salary report program for user use. However, user wants the
> output is excel format. So, I use "copy to ...type xls" command to export
> data to excel file. My problem is : create many excel file after run
> program. Because, I separate each employee have one excel file. But user
> wants one excel file to store all employee(separate page in excel). I am
> no
> idea how to do that. Anyone have go that before? Please advice.
>
> Thanks
> Edmond
>
>



Re: one excel file ? by Cindy

Cindy
Wed Dec 01 21:19:05 CST 2004

Hi Edmond,

Try this:

Create Cursor Test1 (Field1 C(10))
Insert Into Test1 Values ("Hello")
Insert Into Test1 Values ("World")

Create Cursor Test2 (Field1 C(10))
Insert Into Test2 Values ("FoxPro")
Insert Into Test2 Values ("Rocks")

oExcel = CreateObject("Excel.Application")
oExcel.Visible = .T. && For testing
oBook = oExcel.Workbooks.Add()

*-- Get the first data
Select Test1
Go Top
_Vfp.DataToClip(,,3)

oExcel.ActiveSheet.Paste
oExcel.ActiveSheet.Name = Alias()

*-- Get the second data
Select Test2
Go Top
_Vfp.DataToClip(,,3)

oExcel.Worksheets.Add()
oExcel.ActiveSheet.Paste
oExcel.ActiveSheet.Name = Alias()

oBook.SaveAs("YourFilenameHere0
oExcel.Quit
Release oExcel


--
Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP
cindy_winegarden@msn.com www.cindywinegarden.com


<Edmond> wrote in message news:%23ZxOStB2EHA.3324@tk2msftngp13.phx.gbl...
> Dear all,
>
> I created a salary report program for user use. However, user wants the
> output is excel format. So, I use "copy to ...type xls" command to export
> data to excel file. My problem is : create many excel file after run
> program. Because, I separate each employee have one excel file. But user
> wants one excel file to store all employee(separate page in excel). I am
> no
> idea how to do that. Anyone have go that before? Please advice.
>
> Thanks
> Edmond
>
>



Re: one excel file ? by Edmond>

Edmond>
Wed Dec 01 21:57:16 CST 2004

Thanks Cindy...
I don't know object how to use it in VFP. Any website provide some tutorial
?

Thanks again

Edmond

"Cindy Winegarden" <cindy_winegarden@msn.com> ¦b¶l¥ó
news:uPyz05B2EHA.3408@tk2msftngp13.phx.gbl ¤¤¼¶¼g...
> Hi Edmond,
>
> Try this:
>
> Create Cursor Test1 (Field1 C(10))
> Insert Into Test1 Values ("Hello")
> Insert Into Test1 Values ("World")
>
> Create Cursor Test2 (Field1 C(10))
> Insert Into Test2 Values ("FoxPro")
> Insert Into Test2 Values ("Rocks")
>
> oExcel = CreateObject("Excel.Application")
> oExcel.Visible = .T. && For testing
> oBook = oExcel.Workbooks.Add()
>
> *-- Get the first data
> Select Test1
> Go Top
> _Vfp.DataToClip(,,3)
>
> oExcel.ActiveSheet.Paste
> oExcel.ActiveSheet.Name = Alias()
>
> *-- Get the second data
> Select Test2
> Go Top
> _Vfp.DataToClip(,,3)
>
> oExcel.Worksheets.Add()
> oExcel.ActiveSheet.Paste
> oExcel.ActiveSheet.Name = Alias()
>
> oBook.SaveAs("YourFilenameHere0
> oExcel.Quit
> Release oExcel
>
>
> --
> Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP
> cindy_winegarden@msn.com www.cindywinegarden.com
>
>
> <Edmond> wrote in message news:%23ZxOStB2EHA.3324@tk2msftngp13.phx.gbl...
> > Dear all,
> >
> > I created a salary report program for user use. However, user wants
the
> > output is excel format. So, I use "copy to ...type xls" command to
export
> > data to excel file. My problem is : create many excel file after run
> > program. Because, I separate each employee have one excel file. But user
> > wants one excel file to store all employee(separate page in excel). I am
> > no
> > idea how to do that. Anyone have go that before? Please advice.
> >
> > Thanks
> > Edmond
> >
> >
>
>



Re: one excel file ? by Edmond>

Edmond>
Wed Dec 01 21:57:32 CST 2004

Thanks for your help

Edmond

"Fred Taylor" <ftaylor@mvps.org!REMOVE> ¦b¶l¥ó
news:e$m1E4B2EHA.2708@TK2MSFTNGP10.phx.gbl ¤¤¼¶¼g...
> Put all the employee records you want to have in the sinle Excel file into
a
> single table or cursor. Create your Excel file from that.
>
> --
> Fred
> Microsoft Visual FoxPro MVP
>
>
> <Edmond> wrote in message news:%23ZxOStB2EHA.3324@tk2msftngp13.phx.gbl...
> > Dear all,
> >
> > I created a salary report program for user use. However, user wants
the
> > output is excel format. So, I use "copy to ...type xls" command to
export
> > data to excel file. My problem is : create many excel file after run
> > program. Because, I separate each employee have one excel file. But user
> > wants one excel file to store all employee(separate page in excel). I am
> > no
> > idea how to do that. Anyone have go that before? Please advice.
> >
> > Thanks
> > Edmond
> >
> >
>
>



Re: one excel file ? by Cindy

Cindy
Wed Dec 01 22:32:34 CST 2004

Hi Edmond,

Try "Microsoft Office Automation with Visual FoxPro" from
http://www.hentzenwerke.com/catalog/autofox.htm.

Also, try instantiating the oExcel object in the VFP Command window and
letting the Intellisense help out.

--
Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP
cindy_winegarden@msn.com www.cindywinegarden.com


<Edmond> wrote in message news:e9ITuKC2EHA.3376@TK2MSFTNGP12.phx.gbl...
> Thanks Cindy...
> I don't know object how to use it in VFP. Any website provide some
> tutorial




Re: one excel file ? by Edmond>

Edmond>
Thu Dec 02 00:52:17 CST 2004

Cindy

thank you so much

Edmond


"Cindy Winegarden" <cindy_winegarden@msn.com> ¦b¶l¥ó
news:OTJTJjC2EHA.1300@TK2MSFTNGP14.phx.gbl ¤¤¼¶¼g...
> Hi Edmond,
>
> Try "Microsoft Office Automation with Visual FoxPro" from
> http://www.hentzenwerke.com/catalog/autofox.htm.
>
> Also, try instantiating the oExcel object in the VFP Command window and
> letting the Intellisense help out.
>
> --
> Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP
> cindy_winegarden@msn.com www.cindywinegarden.com
>
>
> <Edmond> wrote in message news:e9ITuKC2EHA.3376@TK2MSFTNGP12.phx.gbl...
> > Thanks Cindy...
> > I don't know object how to use it in VFP. Any website provide some
> > tutorial
>
>
>