Page 1 of 2

dbf to excel

Posted: Tue Aug 20, 2013 12:10 pm
by BruceN
I can create an excel spreadsheet from a dbf file, however, the collumn names in excel are the field names in the dbf file. Is there a way t o change them to names that can't be used as dbf field names - like 'Type (debit/credit)' or 'Vendor Part Number' ?

thanks

Re: dbf to excel

Posted: Wed Aug 21, 2013 9:10 am
by Auge_Ohr
BruceN wrote:I can create an excel spreadsheet from a dbf file, however, the collumn names in excel are the field names in the dbf file.
"how" did you create Spreadsheet from a Dbf ? did you "import" it within Excel ?

i did not give access to open a Dbf with Excel. I use activeX to create a Spreadsheet so i can write what i want into A1 - Z1 ( Columne Header Line )

Re: dbf to excel

Posted: Wed Aug 21, 2013 9:45 am
by BruceN
oExcel := CreateObject("Excel.Application")
IF Empty( oExcel )
MsgBox( "Excel is not installed" )
RETURN
ENDIF

oExcel:DisplayAlerts := .F.
oExcel:visible := .T.

oBook := oExcel:workbooks:Open(tempfile)

Re: dbf to excel

Posted: Wed Aug 21, 2013 10:05 am
by Auge_Ohr
BruceN wrote: oBook := oExcel:workbooks:Open(tempfile)
ok, i "see" you use activeX but what are your next Step ?

what is your Problem to change Cell A1 - Z1 using o:Value

Code: Select all

oSheet := oBook:ActiveSheet
oSheet:Cells(nRow,nCol):Value := MyValue

Re: dbf to excel

Posted: Wed Aug 21, 2013 10:23 am
by BruceN
ahhh.. wasn't aware of that... i'll try it tomorrow when i take a break from drywalling and have a few minutes free.

Re: dbf to excel

Posted: Wed Aug 21, 2013 11:09 am
by bwolfsohn
BruceN wrote:ahhh.. wasn't aware of that... i'll try it tomorrow when i take a break from drywalling and have a few minutes free.
You have the drywalling module ?? Does that come with the professional subscription ?? 2.0 ?? :mrgreen: :dance:

Re: dbf to excel

Posted: Wed Aug 21, 2013 11:12 am
by Tom
Hi, Bruce.

eXpress++ comes with several functions to export data directly into Excel files, arrays and/or databases (DC_Array2Excel() and DC_Workarea2Excel()). Maybe you should take a look at that. ;)

Customers should never open application data with external programs. Never.

Re: dbf to excel

Posted: Wed Aug 21, 2013 11:19 am
by BruceN
1 - drywalling module comes with owning a house on a bayou in Louisiana. last year in Isaac we got a foot of water. can only do repairs during summer or school breaks (I volunteer as mentor/coach to my son's world championship robotics team at his school in Tampa).

2 - why shouldn't an app be opened with an external program?

Re: dbf to excel

Posted: Wed Aug 21, 2013 11:41 am
by Auge_Ohr
BruceN wrote:2 - why shouldn't an app be opened with an external program?
Tom and i talk about DBF etc. open by external M$ Application ...

Re: dbf to excel

Posted: Wed Aug 21, 2013 1:57 pm
by Tom
Hi, Bruce.
why shouldn't an app be opened with an external program?
As Jimmy mentioned - I was talking about data. If your customers play around with Access, Excel and other great programs, using the tables while the data is in use, they create heavy trouble (at least locking and file opening will fail). The heaviest trouble comes around if they try to store the data. Your app won't be able to use those tables anymore, since they will be corrupted in > 99 percent of the situations.

So, tell your customers not to do so. Provide exporting routines to create clipboard data, excel sheets or whatever. You have all functions for this inside eXpress++. It's one line of code to create an excel sheet from a workarea or even an array, including the button to start the process. ;)