Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Save, save as, page setup dimmed out in unprotected excel sheet? | Excel Discussion (Misc queries) | |||
prompt user to save file as {desired_name} and save it to a variab | Excel Programming | |||
Disable save, save as, but allow save via command button | Excel Programming | |||
How to diasble save and save as menu but allow a save button | Excel Programming | |||
Totally Disabling (^ save ) (Save as) and Save Icon – Which code do I use: | Excel Programming |