Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,718
Default msoFileDialogSaveAs

FYI, if your goal is to assist the user in saving the workbook I think most
developers use Application.GetSaveAsFilename. This gives you more control
as you can set a default name, check/modify the name and folder the user
selects, etc.

Sub SaveFile()
Dim FName As Variant
FName = Application.GetSaveAsFilename(, "Excel files (*.xls),*.xls")
If FName = False Then
MsgBox "User cancelled"
Else
ActiveWorkbook.SaveAs FName
End If
End Sub


--
Jim
"DKS" wrote in message
...
|I have two questions on the usage of msoFileDialogSaveAs:
|
| (a) in the following code
| With Application.FileDialog(msoFileDialogSaveAs)
| .Show
| .Execute
| End With
|
| when the .execute method is run, a dialog box is saved where one can
browse
| to a folder and save the file. Nevertheless, the dialog box provides a
| CANCEL option also. How do I trap programatically if the user clicks on
| CANCEL button?
|
| (b) second question
|
| My .xls with a macro using the msoFileDialogSaveAs gives an error when run
| from the PC of my friends and colleagues. The error is on the .execute
| method where excel gives an error that the method cannot be applied (or
does
| not exist - I forgot the actual error message but can find out if somebody
| out there needs to know the exact error message).
|
| Any idea why this method works on my PC and not on other's PC with exactly
| same configuration (XP, Excel 2003). I thought that this could have to do
| something with Add-ins. I removed all add-ins from my PC (by simply
| deselecting add-ins via TOOLS, ADD-IN ...). After deselecting all add-ins
I
| re-ran the macro on my PC and it works fine. Thus it cannot be add-in (or
so
| I believe).
|
| All help appreciated.


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
msoFileDialogSaveAs problem Macka Excel Programming 0 June 30th 05 02:44 PM


All times are GMT +1. The time now is 08:22 AM.

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"