Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How i can read and / or write excell sheet without having MS-Office

Status
Not open for further replies.

capri1966

Programmer
May 13, 2010
57
ES
Hello, I've some applications installed and some of these users haven`t MS-Office installed, they use OpenOfice and i'm trying to read dbf archives to convert to xls archive. How i can read or write xls archives from dbf files without using 'excell.application' for example ?. Can i create xls files directly without automation ?
 
I'm not sure what you mean by "xls archive" files. But if these are standard Excel workbooks, then you can import them into VFP with APPEND FROM or IMPORT. Similarly, you can use COPY TO or EXPORT to export.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Dear Mike, when i try to use IMPORT then VFP stop the execution and return to system,
 
i'm using the IMPORT and APPEND FROM and i'cant update the dbf from xls in both cases. I'm trying to do with ODBC, i've found some code to do this. The code is:


cFileXLS=”C:\xls\archivo.xls”
cConn = "Driver={Microsoft Excel Driver (*.xls)};"+;
"DriverId=790;Dbq="+cFileXLS+;
";DefaultDir="+Justpath(cFileXLS)+";"
nH = SqlStringConnect(cConn)
SQLTables(nH,"", "SheetNames")
cTabla = Trim(SheetNames.Table_Name)
cCursor = Chrtran(cTabla," $","_")
SQLExec(nH,'Select * From ['+cTabla+']',cCursor)



 
This is getting confusing. You said you had a problem with your IMPORT command, and I'm trying to help you to solve that. Now you are talking about ODBC and SQLEXEC().

If you still want help with IMPORT (or APPEND FROM), please answer my previous questions.

If you want to abandon that, and take the SQLEXEC() route, that's fine. But it's no use just throwing up some code without telling us what problems you are seeing. Does that code work? What error message are you seeing, if any?

Also, you can go a long way to debugging this yourself. You should check that the value returned from SQLSTRINGCONNECT() is valid; that the cursor created by SQLTABLES() contains what you expected; and that you have a valid reply from SQLEXEC().

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top