A couple of thoughts:
I got this "Statement is not in a procedure" error a while ago. Turned
out it was because I had 'defined' a class earlier in the code file.
Cured it by moving the class def to the end. (Yes, I did have an
enddefine statement, but it didn't matter.)
This looks like data conversion code, and if it never executed that
would explain the empty output. But why some files and not others? Is
it possible that a) there is a class definition ahead of this code and
b) the class is instantiated in some instances (particular type of data
field) and not others?
Just more stuff for you to chase! <g>
Dan Covill
On 10/25/2010 2:22 PM, Carl Lindner wrote:
> Rick,
>
> Yes records. No filters. I am running the prg in the example:
> CopyToExcel("C:\Test.xlsx", "Sheet1", "MyTable"). I have not touched
> Craig's code except for inserting this line.
>
> I converted 8863 records of one file and 7131 of another - no doubt it works
> but seemingly - not always..
>
> I am having problems with 2 files that I know of. One is "tr.dbf". The
> number of records is 104. Originally there were 65 fields with a length of
> 479. I removed all numeric fields. I deleted all tags. I deleted all
> integers. I deleted all currency types. At each of these steps it would
> create the xlsx with only the field names in row 1 - no other rows. I was
> down to 104 records and 25 fields with a width of 125. I was looking for
> some "bad fields" - hidden ascii characters... maybe a "bad" field name.
>
> Then I brought in a clients table of the same structure. It does not
> convert.
>
> But, along the way and at the end -- other tables converted properly.
>
> I also noticed an appendxlsx.err file. It echoes the last half dozen or so
> lines of Craig's code. I can generate the error file by deleting it, and
> deleting the fxp and running appendxlsx.
>
> At this point I can convert other files but not tr.dbf. Here is
> appendxslx.err :
>
> LOCAL lcBinary, lcCode
> Error in line 677: Statement is not in a procedure.
> _cliptext = STRCONV(FILETOSTR(GETFILE()),15)
> Error in line 678: Statement is not in a procedure.
> m.lcBinary = _ClipText
> Error in line 679: Statement is not in a procedure.
> m.lcCode = ""
> Error in line 680: Statement is not in a procedure.
> DO WHILE !EMPTY(m.lcBinary)
> Error in line 681: Statement is not in a procedure.
> m.lcCode = m.lcCode + CHR(9) + iif(Empty(m.lcCode), "m.FileBinary = ",
> "m.FileBinary = m.FileBinary + ") + "0h" + LEFT(m.lcBinary, 510) + CHR(13) +
> CHR(10)
> Error in line 682: Statement is not in a procedure.
> m.lcBinary = SUBSTR(m.lcBinary, 511)
> Error in line 683: Statement is not in a procedure.
> ENDDO
> Error in line 684: Statement is not in a procedure.
> _cliptext = m.lcCode
> Error in line 685: Statement is not in a procedure.
>
> Despite this evident problem, other files convert. Your thoughts would be
> appreciated.
>
> Carl
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/[email protected]
** 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.