Thread: Save as DBF
View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
bijan bijan is offline
external usenet poster
 
Posts: 44
Default Save as DBF

Thanks Jole
It works grate but I had to remove this part:
If fileSaveName < False Then
MsgBox("Cannot open file - Exiting macro")
exit sub
End If
beacuse, it just returns the text of msgbox
Bijan

"Joel" wrote:


fileSaveName = Application.GetSaveAsFilename( _
fileFilter:="DBF Files (*.dbf), *.dbf")
If fileSaveName < False Then
MsgBox("Cannot open file - Exiting macro")
exit sub
End If


Sheets("test").Copy
Set Newbk = ActiveWorkbook
Newbk.SaveAs _
Filename:=fileSaveName, _
FileFormat:=xlDBF4
Newbk.Close savechanges:=True


"bijan" wrote:

Hi,Joel
Thanks for code,How can change this code to ask me by a message box to set a
filename instead of test.dbf
Thanks
Bijan
"Joel" wrote:

'create new workbook with only one sheet
'copy without using before or after put sheet in new workbook
Sheets("test").Copy
Set Newbk = ActiveWorkbook
Newbk.SaveAs _
Filename:="C:\test\test.dbf", _
FileFormat:=xlDBF4
Newbk.Close savechanges:=True

"bijan" wrote:

Hi
I'am using excel 2003, need a sample code for save as a non-active
sheet("test") to dBASE IV in C:\test\test.dbf and dont save as my workbook.
Thanks in advance