Results 1 to 3 of 3

Thread: excel & vis fox

  1. #1
    Join Date
    Nov 2005

    Unanswered: excel & vis fox

    i am trying to call excel from visfox to help in converting a csv file to an xls. the code could be in vb, and i can convert that if needed.

    situation is i receive a text file that is a semi-colon seperated file (as it has some commas in it that bugger the columns up) so i wrote a text converted to change all the commas to a space and then the semi-colons to a comma. now i have a csv that excel will open.

    now i have to reach out to excel, pass the name of the file, tell it to add a column at AB, then save the file as an .xls.

    any help is appreciated.



  2. #2
    Join Date
    Nov 2002
    Provided Answers: 1
    Assuming that you are starting here:
    "i receive a text file that is a semi-colon separated file"

    It sounds as though you already have a working method of converting the file into a CSV file. That's a good place to start.

    I'd recommend that you look at getting the reference book:
    Microsoft Office Automation with Visual FoxPro
    Hentzenwerke Moving from Windows to Linux

    Or, alternatively, there are other VFP forums where more VFP Excel Automation code examples are given, but referencing them specifically here would not be an ethical use of this forum.

    One note - After having done a LOT of VFP Automation of Excel myself, I generally proceed along the following steps.
    I first do the very same operations that I want to perform manually in Excel (no VFP involved at all) and record the actions as a Macro.
    Then, when complete, I Stop Recording the Macro and examine it within Excel to see how it was done.
    Finally I go into VFP and write the Excel Automation code to do the very same thing using the Macro code as a guide.

    Good Luck

  3. #3
    Join Date
    Nov 2005
    thanks for the quick reply

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts