dbf to excel

This forum is for general support of Xbase++
Message
Author
BruceN
Posts: 280
Joined: Thu Jan 28, 2010 7:46 am
Location: Slidell, LA

dbf to excel

#1 Post 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
There are only 10 kinds of people - those who understand binary and those who don't :)

User avatar
Auge_Ohr
Posts: 1406
Joined: Wed Feb 24, 2010 3:44 pm

Re: dbf to excel

#2 Post 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 )
greetings by OHR
Jimmy

BruceN
Posts: 280
Joined: Thu Jan 28, 2010 7:46 am
Location: Slidell, LA

Re: dbf to excel

#3 Post 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)
There are only 10 kinds of people - those who understand binary and those who don't :)

User avatar
Auge_Ohr
Posts: 1406
Joined: Wed Feb 24, 2010 3:44 pm

Re: dbf to excel

#4 Post 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
greetings by OHR
Jimmy

BruceN
Posts: 280
Joined: Thu Jan 28, 2010 7:46 am
Location: Slidell, LA

Re: dbf to excel

#5 Post 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.
There are only 10 kinds of people - those who understand binary and those who don't :)

bwolfsohn
Posts: 648
Joined: Thu Jan 28, 2010 7:07 am
Location: Alachua, Florida USA
Contact:

Re: dbf to excel

#6 Post 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:
Brian Wolfsohn
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises

User avatar
Tom
Posts: 1169
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: dbf to excel

#7 Post 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.
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

BruceN
Posts: 280
Joined: Thu Jan 28, 2010 7:46 am
Location: Slidell, LA

Re: dbf to excel

#8 Post 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?
There are only 10 kinds of people - those who understand binary and those who don't :)

User avatar
Auge_Ohr
Posts: 1406
Joined: Wed Feb 24, 2010 3:44 pm

Re: dbf to excel

#9 Post 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 ...
greetings by OHR
Jimmy

User avatar
Tom
Posts: 1169
Joined: Thu Jan 28, 2010 12:59 am
Location: Berlin, Germany

Re: dbf to excel

#10 Post 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. ;)
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."

Post Reply