Wait, you are one hour lagging and you stop working? Not to bad ...
>It stops at the endtry - thanks Tore for all your time - I am going to call it a day
>
>>>>Set a breakpoint at the first line, and open the debugger. Then you step through each line, and notice what's going on.
>>>
>>>Never done that in all the years i have been using VFP - how do I do it?
>>
>>Then you have spent much time unnecessarily.
>>1. Doubleclick in the left column in the editor, and you will see a red dot appear. This red dot indicates a breakpoint.
>>2. Open the debugger
>>3. Run your program
>>Now the program will stop at the line with the breakpoint, and you can step through the code, one line at the time.
>>
>>Update:
>>
>>I strongly recommend that you read this article written by Tamar:
http://www.tomorrowssolutionsllc.com/Articles/Learn%20to%20Use%20the%20Debugger.PDF>>
>>>>
>>>>>>And which line is no. 26?
>>>>>
>>>>>Sorry it was line 28 - ENDTRY
>>>>>>
>>>>>>>>Would be nice to know the errorcodes :)
>>>>>>>
>>>>>>>Unhandled structured exception
>>>>>>>Error no 1429
>>>>>>>Lineno26
>>>>>>>
>>>>>>>
>>>>>>>>
>>>>>>>>>I haven't used functions before - I have always avoided them - this is my code but it gives errors
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>DO xls_import
>>>>>>>>>
>>>>>>>>>FUNCTION xls_import
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>PARAMETERS tcFile
>>>>>>>>>** Replaces VFP Import Command for XLS. VFP Command does not accept xlsx file formats
>>>>>>>>>** First try the standard import.
>>>>>>>>>** If it failes with error code 1661 (Microsoft Excel file format is invalid.) then open Excel and resave with format 39( xlExcel5, xlExcel7 )
>>>>>>>>>** Try to import again.
>>>>>>>>>** If it succeeds, return the name of the table
>>>>>>>>>** If it still fails, return an empty string. Calling program will check for EMPTY() to determine success
>>>>>>>>>
>>>>>>>>>LOCAL lcReturn,lcNewFile
>>>>>>>>>lcReturn = ""
>>>>>>>>>
>>>>>>>>>TRY
>>>>>>>>> IMPORT FROM ("c:\colin.xlsx") XLS
>>>>>>>>> lcReturn = DBF()
>>>>>>>>>CATCH
>>>>>>>>> =AERROR(abcde)
>>>>>>>>> IF abcde[1] = 1661
>>>>>>>>> tmpoxl=CREATEOBJECT("excel.application")
>>>>>>>>> tmpoxl.DisplayAlerts = .F.
>>>>>>>>> tmpoxl.Application.WorkBooks.Open(tcFile)
>>>>>>>>> lcNewFile = "c:\tempdl\" + JUSTFNAME(tcfile)
>>>>>>>>> tmpoxl.activeworkbook.saveas(lcnewfile,39)
>>>>>>>>> tmpoxl.quit
>>>>>>>>> tmpoxl= .null.
>>>>>>>>> TRY
>>>>>>>>> IMPORT FROM (lcnewfile) xls
>>>>>>>>> lcReturn = DBF()
>>>>>>>>> CATCH
>>>>>>>>> ENDTRY
>>>>>>>>> DELETE FILE (lcnewfile)
>>>>>>>>> ENDIF
>>>>>>>>>ENDTRY
>>>>>>>>>RETURN lcReturn
>>>>>>>>>
Words are given to man to enable him to conceal his true feelings.
Charles Maurice de Talleyrand-Périgord
Weeks of programming can save you hours of planning.
OffThere is no place like [::1]