Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Prompt for SaveAsDialog with file type preset.

I want to prompt the user for a save as file name and defualt the file type
to csv. I am trying
Application.Dialogs(xlDialogSaveAs).Show Arg2:=xlCSV
result: saves file as csv then code is interrupted
also tried
Filename = Application.GetSaveAsFilename( _
fileFilter:="Comma Seperated Values (*.csv), *.csv")
result: no interruption but does not save file and cannot recall name using
ActiveWorkbook.SaveAs




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default Prompt for SaveAsDialog with file type preset.

maybe...

dim myFileName as Variant
myfilename = application.getsaveasfilename("comma separated values, *.csv")
if myfilename = false then
'user hit cancel
else
activeworkbook.saveas filename:=myfilename, fileformat:=xlCSV
end if

..getsaveasfilename won't do the save, but it'll give you the name--so you can do
your own save.

invictus1964 wrote:

I want to prompt the user for a save as file name and defualt the file type
to csv. I am trying
Application.Dialogs(xlDialogSaveAs).Show Arg2:=xlCSV
result: saves file as csv then code is interrupted
also tried
Filename = Application.GetSaveAsFilename( _
fileFilter:="Comma Seperated Values (*.csv), *.csv")
result: no interruption but does not save file and cannot recall name using
ActiveWorkbook.SaveAs


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Prompt for SaveAsDialog with file type preset.

I use this
/code
Sub CSVName()
FullFileName = Application.GetSaveAsFilename("", "CSV (Comma
delimited)(*.csv),*.csv", 1, "Save As *.csv")
If FullFileName < "False" Then
ActiveWorkbook.SaveAs Filename:=FullFileName, FileFormat:=xlCSV
End If
End Sub
/code

Craig


"invictus1964" wrote in message
...
I want to prompt the user for a save as file name and defualt the file

type
to csv. I am trying
Application.Dialogs(xlDialogSaveAs).Show Arg2:=xlCSV
result: saves file as csv then code is interrupted
also tried
Filename = Application.GetSaveAsFilename( _
fileFilter:="Comma Seperated Values (*.csv), *.csv")
result: no interruption but does not save file and cannot recall name

using
ActiveWorkbook.SaveAs






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
Import text file into excel with preset file layout, delimeters VBA meldrape Excel Programming 7 June 15th 04 08:31 PM
file prompt larry hensel Excel Programming 1 February 3rd 04 03:37 PM
Prompt user to select file with default file selected dialog Bruce Cooley Excel Programming 0 September 15th 03 06:43 AM
Prompt user to select file with default file selected dialog Bob Phillips[_5_] Excel Programming 0 September 14th 03 09:22 PM
Prompt user to select file with default file selected dialog Bob Phillips[_5_] Excel Programming 0 September 14th 03 09:19 PM


All times are GMT +1. The time now is 12:57 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"