ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   how to read dbf file using macro? (https://www.excelbanter.com/excel-programming/372951-how-read-dbf-file-using-macro.html)

musa.biralo

how to read dbf file using macro?
 
Hi,
i want to read each row of specific column of musa.dbf using macro
(VBA) in excel.
my main gole is to copy the data of dbf file to excel file.
I am new but want to do something..i tried and tried...and finally i am
here....
help me.

musa.biralo


Tom Ogilvy

how to read dbf file using macro?
 
if it is dbf 3 of 4 format

Dim sPath as String
sPath = "C:\MyDBFFiles\"
workbooks.Open sPath & musa.dbf
Activeworkbook.SaveAs sPath & "musa.xls", xlWorkbookNormal



--
Regards,
Tom Ogilvy



"musa.biralo" wrote in message
ups.com...
Hi,
i want to read each row of specific column of musa.dbf using macro
(VBA) in excel.
my main gole is to copy the data of dbf file to excel file.
I am new but want to do something..i tried and tried...and finally i am
here....
help me.

musa.biralo




musa.biralo

how to read dbf file using macro?
 
Thank you Tom

This code simply saved the musa.dbf as musa.xls.

My main target is to get the DATA from a simple dbf file and populate
it in excel. what my real need is to open the dbf file and get the
value from there then populate the value in excel.

Can you direct me to the place where i can get such information. if you
have such code that will be the best....

Once again, thank you for the help.

Tom Ogilvy wrote:
if it is dbf 3 of 4 format

Dim sPath as String
sPath = "C:\MyDBFFiles\"
workbooks.Open sPath & musa.dbf
Activeworkbook.SaveAs sPath & "musa.xls", xlWorkbookNormal



--
Regards,
Tom Ogilvy



"musa.biralo" wrote in message
ups.com...
Hi,
i want to read each row of specific column of musa.dbf using macro
(VBA) in excel.
my main gole is to copy the data of dbf file to excel file.
I am new but want to do something..i tried and tried...and finally i am
here....
help me.

musa.biralo



NickHK[_3_]

how to read dbf file using macro?
 
Can you Query the database/file /
Check out DataNew Database query and follow the Wizard.
Make sure you understand about DSNs and/or connection string.

NickHK

"musa.biralo"
roups.com...
Thank you Tom

This code simply saved the musa.dbf as musa.xls.

My main target is to get the DATA from a simple dbf file and populate
it in excel. what my real need is to open the dbf file and get the
value from there then populate the value in excel.

Can you direct me to the place where i can get such information. if you
have such code that will be the best....

Once again, thank you for the help.

Tom Ogilvy wrote:
if it is dbf 3 of 4 format

Dim sPath as String
sPath = "C:\MyDBFFiles\"
workbooks.Open sPath & musa.dbf
Activeworkbook.SaveAs sPath & "musa.xls", xlWorkbookNormal



--
Regards,
Tom Ogilvy



"musa.biralo" wrote in message
ups.com...
Hi,
i want to read each row of specific column of musa.dbf using macro
(VBA) in excel.
my main gole is to copy the data of dbf file to excel file.
I am new but want to do something..i tried and tried...and finally i am
here....
help me.

musa.biralo





Tom Ogilvy

how to read dbf file using macro?
 
my main gole is to copy the data of dbf file to excel file.

so when it is saves as an excel file, the data from the dbf file isn't in an
excel file?

I believe it is. If you want to populate an existing file, then open it in
excel as I have shown you, then access the cells you want and place the
values in the location you want of the existing file. then close the open
dbf file without saving.

You can also approach it as Nick has suggested - it is pretty much the same.

--
Regards,
Tom Ogilvy

"musa.biralo" wrote:

Thank you Tom

This code simply saved the musa.dbf as musa.xls.

My main target is to get the DATA from a simple dbf file and populate
it in excel. what my real need is to open the dbf file and get the
value from there then populate the value in excel.

Can you direct me to the place where i can get such information. if you
have such code that will be the best....

Once again, thank you for the help.

Tom Ogilvy wrote:
if it is dbf 3 of 4 format

Dim sPath as String
sPath = "C:\MyDBFFiles\"
workbooks.Open sPath & musa.dbf
Activeworkbook.SaveAs sPath & "musa.xls", xlWorkbookNormal



--
Regards,
Tom Ogilvy



"musa.biralo" wrote in message
ups.com...
Hi,
i want to read each row of specific column of musa.dbf using macro
(VBA) in excel.
my main gole is to copy the data of dbf file to excel file.
I am new but want to do something..i tried and tried...and finally i am
here....
help me.

musa.biralo





All times are GMT +1. The time now is 06:30 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com