Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default xlDialogs(xlDialogSaveAs)

I want to suggest a name for the file being saved and test for a return. I
can't seem to do both.
This opens the dialog box and displays my suggested name:
Application.Dialogs(xlDialogSaveAs).Show strSaveAsName
[strSaveAsName contains the suggested name which changes each time the macro
runs]

This allows me to capture the return value from the dialog box:
rtrnVal = Application.Dialogs(xlDialogSaveAs).Show

This gives an error message from the compilier saying that it's looking for
the end of the statement and highlights the variable:
rtrnVal = Application.Dialogs(xlDialogSaveAs).Show strSaveAsName

Please tell me what I'm missing. Thank you very much for your help.
--
Dan Mullen
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default xlDialogs(xlDialogSaveAs)

Try this

rtrnVal = Application.GetSaveAsFilename(strSaveAsName , _
fileFilter:="Excel Files (*.xls), *.xls")


--
Regards Ron de Bruin
http://www.rondebruin.nl


"DanM" wrote in message ...
I want to suggest a name for the file being saved and test for a return. I
can't seem to do both.
This opens the dialog box and displays my suggested name:
Application.Dialogs(xlDialogSaveAs).Show strSaveAsName
[strSaveAsName contains the suggested name which changes each time the macro
runs]

This allows me to capture the return value from the dialog box:
rtrnVal = Application.Dialogs(xlDialogSaveAs).Show

This gives an error message from the compilier saying that it's looking for
the end of the statement and highlights the variable:
rtrnVal = Application.Dialogs(xlDialogSaveAs).Show strSaveAsName

Please tell me what I'm missing. Thank you very much for your help.
--
Dan Mullen



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
xlDialogs - Sheet Name List Trevor Williams Excel Programming 2 November 1st 04 03:41 PM
Setting the default filename in xlDialogSaveAs John Wirt[_6_] Excel Programming 1 May 19th 04 10:17 AM
xlDialogSaveAs Tim Cadieux Excel Programming 0 September 18th 03 06:52 PM
Problem setting directory in xlDialogSaveAs Jonathan Crow Excel Programming 1 September 18th 03 06:06 PM
application.dialogs(xlDialogSaveAs) AND CHDIR Jules[_2_] Excel Programming 1 September 3rd 03 08:27 PM


All times are GMT +1. The time now is 06:09 PM.

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

About Us

"It's about Microsoft Excel"