Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Windows XP
Excel 2002 I have a bit of code that is supposed to prompt the user for a path and file name to save their workbook in, but I'm getting an error. The user is intended to save a single worksheet workbook as a dbf file, and all the necessary elements are present. Here is the code: Sub SaveCoordinates() Dim Filt As String Dim FilterIndex As Integer Dim Title As String Dim FileName As String Dim InitialFileName As String FileName = "" ' Set up list of file filters Filt = "DBF file (*.dbf)" ' Display *.dbf* by default FilterIndex = 1 ' Set the dialog box caption Title = "Save Coordinates" ' Default File name InitialFileName = "New_Coord_data" ' Get the file name FileName = Application.GetSaveAsFilename( _ InitialFileName:=InitialFileName, _ FileFilter:=Filt, _ FilterIndex:=FilterIndex, _ Title:=Title) Application.DisplayAlerts = False ActiveWorkbook.SaveAs FileName:=FileName Application.DisplayAlerts = True End Sub So, could someone kindly tell me what is wrong with the above code? Any help greatly appreciated - thanks! -gk- |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Question on saving a file. | Excel Discussion (Misc queries) | |||
Saving Excel 2007 file in 2003 creates very large file | Excel Discussion (Misc queries) | |||
Confused here Prevent Saving File - but allow ONLY File SAVEAS Met | Excel Discussion (Misc queries) | |||
Saving worksheet in new file with date AND cell value as file name | Excel Discussion (Misc queries) | |||
How do I stop Excel 2000 from saving file history from file that . | Excel Discussion (Misc queries) |