Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Modifying Excel Import Procedure?
Message
From
11/04/2002 19:29:05
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
11/04/2002 11:56:02
N. Lea
Nic Cross Enterprises
Valencia, California, United States
General information
Forum:
Visual FoxPro
Category:
Third party products
Miscellaneous
Thread ID:
00643706
Message ID:
00644025
Views:
14
>Oh, I did download the constant for Excel via the link you provided. I still got the message. I would not try it without it. I know API can be tricky sometimes.

It worked for me. Let me compile a brief checklist, HTH.

  • Get the download.
  • Extract the constants file, and place it (for a start) in the same folder as the sample program I included.
  • Eliminate the folder reference from my sample program.
  • Make sure the constant names (xl...) are spelled exactly the same in the constants file, and in the VFP program.
  • Make sure the VFP program has an #INCLUDE statement, and that the filename matches the name of the file on disk.

    I don't know, what else might go wrong...

    Hilmar.

    >
    >>xlDBF3 is a constant which - initially - Excel understands, but VFP not. The relevant Excel constants are defined in download #1005. Please get it! That's what I have the #INCLUDE command for.
    >>
    >>Hilmar.
    >>
    >>>Thanks for the assistance with all this stuff. Unfortunately, it does not seem to be taking to Office XP too well. It cannot find the variable xlDBF3.I am assuming that is what it is supposed to convert it to.
    >>>
    >>>>Download #9498 contains Excel constants. You need it for the following program.
    >>>>
    >>>>The result will be exactly the same as if you export manually from Excel. For best results, the spreadsheet should have a first row with column (field) names.
    >>>>
    >>>>
    >>>>#include include\xl97cons.h
    >>>>oExcel = CreateObject("Excel.Application")
    >>>>oExcel.Visible = 1   && for debugging
    >>>>oExcel.Workbooks.Open(fullpath("") + "sample.xls")
    >>>>erase sample.dbf
    >>>>oExcel.ActiveWorkbook.SaveAs(fullpath("") + "sample.dbf", xlDBF3)
    >>>>oExcel.Activeworkbook.Close(0)
    >>>>
    >>>>
    >>>>See also: SET CPDIALOG.
    >>>>
    >>>>HTH, Hilmar.
    >>>>
    >>>>>I attempted to export directly from Excel, but it cut off a lot of the data. i looked up the automation, but I do not understand it's process. I am attemping to create the table first and append from, but it will not let me append from an xls file.
    Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
  • Previous
    Reply
    Map
    View

    Click here to load this message in the networking platform