#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Save as DBF

Joel meant = False as below ... to exit the macro if no file is selected..

If fileSaveName = False Then
MsgBox ("Cannot open file - Exiting macro")
Exit Sub
End If

If this post helps click Yes
---------------
Jacob Skaria


"bijan" wrote:

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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Save, save as, page setup dimmed out in unprotected excel sheet? ccKeithJ Excel Discussion (Misc queries) 3 December 14th 07 07:07 PM
prompt user to save file as {desired_name} and save it to a variab GeneWan Excel Programming 1 January 5th 07 06:46 AM
Disable save, save as, but allow save via command button TimN Excel Programming 10 September 1st 06 07:05 PM
How to diasble save and save as menu but allow a save button hon123456 Excel Programming 1 June 12th 06 09:50 AM
Totally Disabling (^ save ) (Save as) and Save Icon – Which code do I use: harpscardiff[_10_] Excel Programming 8 November 10th 05 12:24 PM


All times are GMT +1. The time now is 07:22 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"