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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Save worksheet as .dbf

Status
Not open for further replies.

rangerstud620

Programmer
Sep 17, 2003
34
0
0
US
I'm creating an Excel macro that edits the current worksheet and then saves it as a DBF. I can't figure out how to save it as a .dbf though. I'm guessing I need to use ActiveSheet.SaveAs, but I'm not sure what exactly to put in for file format. Does anyone have any ideas? Thanks
 
Yes I did recording the save process but it did not work. I'm not sure if I did something wrong so it didn't work. Any ideas?
 
Yes I did recording the save process but it did not work. I'm not sure if I did something wrong so it didn't work, or what happened. Any ideas?
 
hey STUD!

Better brush up on yer macro recording skills! Excel 101!
Code:
    ActiveWorkbook.SaveAs _
        Filename:="C:\SapWorkDir\Pac3OrderReservations.dbf", _
        FileFormat:=xlDBF4, _
        CreateBackup:=False
;-)



Skip,
Skip@TheOfficeExperts.com
 
Thanks Skip...I wasn't sure how to reference the DBF4 file format type.
 
It is listed in the save as dialog box. I tried referencing the file format as *.dbf, dbf4, and dbfIV. Obviously none of those worked. I did find a list of all the xlFileFormat constants now, so I shouldn't have a problem with that anymore:)
 
When I used *.dbf, dbf4, and dbfIV as the file format, I kept getting an error (can't remember what exactly the error was though).
 
Actually, I tried recording the macro and it did not record correctly...it would not change the file format. So I had to manually edit the macro code to do the Save As process. That's when I kept getting the file format error.
 
Yeah I went through it twice. I couldn't get it to work properly so I modified the code a bit and it works ok now.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top