Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Append XlS

I am trying to append from an excel worksheet into a foxpro table. I had
this in a program, and at one time this worked correctly. Now I get Fatal
Error: Exception Code C0000005. When I just try to append from the foxpro
window it basically issues the quit command and I get shoved back out to
windows. The fields in the table are set up correctly and I am using the
same version of excel as I always have. Is my syntax wrong or am I missing
something? If I import and then append from the dbf it works but this is
not practical in my application. I am using vfp 6.0.

EX:
close databases
use f:\lagers\wagesin\wagesin exclusive
set safety off
zap
set safety on
set default to f:\lagers\wagesin\

select wagesin
append from dec_3824.xls type xls
[817 byte] By [lori] at [2007-11-10 12:48:29]
# 1 Re: Append XlS
Lori,
What version of Excel created this XLS file? Even VFP 8.0's help file only indicates it can handle
up to Excel 97 (v 8.0) - Excel 2002 is version 10.0. Starting around VFP 6.0, it was expected that
you would use automation to retrieve data from Office file types - it's much more controllable,
although a bit more complex.

Rick

"lori" <lori2-1@excite.com> wrote in message news:3e4d08e2$1@tnews.web.dev-archive.com...
>
> I am trying to append from an excel worksheet into a foxpro table. I had
> this in a program, and at one time this worked correctly. Now I get Fatal
> Error: Exception Code C0000005. When I just try to append from the foxpro
> window it basically issues the quit command and I get shoved back out to
> windows. The fields in the table are set up correctly and I am using the
> same version of excel as I always have. Is my syntax wrong or am I missing
> something? If I import and then append from the dbf it works but this is
> not practical in my application. I am using vfp 6.0.
>
> EX:
> close databases
> use f:\lagers\wagesin\wagesin exclusive
> set safety off
> zap
> set safety on
> set default to f:\lagers\wagesin\
>
> select wagesin
> append from dec_3824.xls type xls
Rick Bean at 2007-11-11 23:51:43 >
# 2 Re: Append XlS
Lori,

Is there any chance the worksheet is corrupt or has some odd data that VFP
can't handle? A likely suspect is an invalid date - I had problems with that
once.

Try making a little test spreadsheet with a few rows/columns and only
character and numeric fields. Create a cursor in VFP and append from the
test spreadsheet. If that works, add a date column and see how it goes.

--
Cindy Winegarden MCSD, Microsoft Visual FoxPro MVP
cindy.winegarden@mvps.org http://cindywinegarden.adsl.duke.edu
http://mdsn.microsoft.com/vfoxpro http://foxcentral.net

"lori" <lori2-1@excite.com> wrote in message
news:3e4d08e2$1@tnews.web.dev-archive.com...
>
> I am trying to append from an excel worksheet into a foxpro table. I had
> this in a program, and at one time this worked correctly. Now I get Fatal
> Error: Exception Code C0000005.
Cindy Winegarden at 2007-11-11 23:52:37 >